The Safe bitstream gets mentioned occasionally in our documentation and warning/error messages and this blog post attempts to shed some light on what it is and what it’s used for.

What is the Safe bitstream?

The Safe bitstream is the default binary data that is shifted into the JTAG devices. The aim of the safe bitstream is to disable as much of the board as possible. This means that in general, logic devices that have a chip enable pin will be disabled, and pins on the JTAG devices will be setup as input pins wherever possible.

How is it generated?

The Safe bitstream is generated automatically by XJEase, and derives first of all from the BSDL files in the project. Part of the description of the boundary scan register includes the values needed to disable pins, and what the resulting disabled value will be, so the starting point for the Safe bitstream is one which disables all possible outputs. This starting point is then modified to take account of any constant pins or disable values where signals need to be driven in order to keep other parts of the circuit disabled. For example, the nOE pin on a RAM device would be set to be driven high (by the disable values in the device busses) to stop the data bus becoming active.

In addition to this, XJTAG’s safe bitstream will drive pins which need to be driven in order to prevent logic devices outputting, e.g the enable pin on a buffer chip.

When is it used?

The Safe bitstream is automatically applied on two occasions:

  1. Before the first test that accesses the boundary scan registers.
  2. At both the beginning and end of the Connection Test.

The user can also cause the Safe bitstream to be applied at any time during device testing by using the in-built SAFE statement.

Note: If you have a standard setup where Checkchain is the first function in your test list this would mean that the Safe bitstream would be applied after Checkchain and before the next function, because the Checkchain function does not use the boundary scan registers.

Warnings and Errors

The most common problem to see relating to the Safe bitstream is a Warning that two conflicting disable values have been set on the same net. In this case XJEase will pick one of the two values. The warning message states which value has been chosen. As with all warnings the project can be run with the warning present but it is best practice to resolve these Safe bitstream conflicts so that the disable values for a net are uniform. It is not safe to rely on the same value always being chosen – updates to XJTAG or modifications to the project may cause it to change.

Calculating the Safe bitstream can also cause an error when you try to run the project (typically at the start, when the safe bitstream is calculated) and testing will stop at this point. The most common cause for the errors is a mistake when defining logic devices in the circuit, causing XJTAG to default the net to a value which is unreachable. If this happens then the error message will list the pins involved in the error and the values they are being set to, so that you can track down the source of the error.