by Tim Pender » Mon May 12, 2008 2:09 pm
I can't quite remember all the details but I thought in one of the 1149 specs IDCODE is optional but if it is included then USERCODE was mandatory.
I also believe that 1532 requires both IDCODE and USERCODE, both are 32 bit registers. Most programmable logic devices are moving to be 1532 compliance.
PLD vendors USERCODE interface
USERCODE is simple to implement but if the designer or DFT engineer does not specify what the value should be, it will be defaulted to whatever the default is in the software could be FFFFFFFF or some PLD vendors will offer an option to automatically fill the field with the CRC signature, typically not enabled by default. In the altera GUI there is a dialog box allowing all of the device programming options (i.e. what file format SVF isc jam jbc etc) as well as the user code. Depending on the PLD vendor software you are using you may also have to modify the BSDL file to implant your USERCODE value. The BSDL file has the instruction to access the USERCODE but does not have the visibility to know what the value is. This is typical with any generic BSDL that you download from the websites. Actel took a different approach. You can not download BSDLs they are created on the fly with the design tool.
Soft BSDL
An Actel bsdl since it is created on the fly and will have actual signal names from your design in the bsdl and the USERCODE value is automatically inserted because the tool has visibility. We would generally have a TCL script to automate the place and route rather than having a designer manually press each button in the gui , typical flow would be to Load the design, assign device / pkg, assign pin numbers, compile, back annotate, route, create timing reports and logging, assign USERCODE, create programming file, save project)
One caveat, even though the USERCODE value is assigned within the TCL script the designer would have to remember to update the revision each time the script was run, I admit that during debug I released a couple different programming files with the same USERCODE because I forgot to update the version. By time these reach production there should be a checklist to make sure the usercodes are unique especially if Boundary Scan will use the USERCODE to determine whether it need to be updated. Auto CRC would guarantee that you have a unique value but you need a magic decoder ring to cross reference CRCs with Date/rev stamps.
One implementation of USERCODE
One of our schemes was to use 5 hexadecimal numbers for the date and 3 others could be used for version. For date stamps we would use one hexadecimal for the month, this would always be 1-C 1 = jan ,A=oct, b =nov, c=dec, you could use two hexadecimals as BCD ( 1 2 = Dec) but we saved on hex number for something else. Day would be 2 hex values, as well as year, Since we may have a couple different flavors within the same day we reserved some of the firmware rev. C2007001 C=Dec, 20 = day, 07 =year, 001 version (obviously we don't need 12 bits for version but it could be used for product ID, Plant ID , or whatever)
ASIC IDCODE OEM or Foundry
Regarding IDCODE in ASICs, you may have been part of all the email communications about a year ago when I sent a message to the BTW distribution list asking for feedback on whose IDCODE should be in the IDCODE field. Should it be the foundry or should it be the company OEM of the design. I got mixed answers some would say a Kodak ID should be in there and some would say it should be the ASIC foundry.
I know that It would be nice to have both, since we may have an asic created by two different foundries, It would be useful to have an IDCODE of the foundry and a second IDCODE of the OEM (Kodak)
Functionally readable IDCODE/USERCODE Registers
I think it would also be good to allow these IDCODE/USERCODE registers be able to read functionally. I know some devices allow you to read the IDCODE via a registers in the device.
Board Versioning
For Board versioning we would bring a nibble of external pullup or pull down resistors to a boundary scan node. We did not want to hard code these values in the design because we had one design that can be used on different boards. The terminators for the board version would tell the FPGA which features to enable or disable. This reduces the number of firmware variants that CM needs to control, rather than having several different programmable part numbers we only need one. In this case where you want one programming file across many different products your USERCODEs needs to be a little more generic, you don't want to have a board ID field specified in the usercode because it will require a different programming file for each unique usercode. since usercode is really treated as a programmable register and its value is determined by the programming file.
Config Prom IDCODEs
When dealling with configuration proms you can specify Two usercodes one will be for the configuration prom and the other will be for the FPGA(SRAM based).
In this case you would need to modify the BSDL for each the config prom and Fpga and update the corresponding values.
EPLDs don't use config proms so you will specify one usercode.