E
Eric Crabill
Guest
Hi,
I hope someone will correct me if I'm wrong on this...
For Xilinx FPGAs, all SLICE flip flops (and some other
synchronous elements, too, like BlockRAM output registers,
IOB flops, etc...) are initialized to a known state at
the end of configuration by an internal, chip-wide async
reset called GSR, or "global set/reset". It also happens
to be the case that there's another signal, GTS, or "global
three-state" that forces all I/O to be three-stated during
configuration. These signals are not "visible" in the FPGA
Editor view of the part at any place other than the STARTUP
component.
If you instantiate specific primitives, like FDC or FDP,
you are also making a request on how you want these to be
initialized by GSR (regardless of your use of an additional,
async user reset). FDC initializes to 0. FDP initializes
to 1.
If you code stuff like:
reg [1:0] myflop;
always @(posedge clk or posedge init)
begin
if (init) myflop <= 2'b10;
else myflop <= two_bit_whatever;
end
You have just inferred an FDC and and FDP, both of which are
initialized by GSR at configuration, and both of which also
have an asynchronous user control called "init".
For a more detailed look, try implementing the code above,
and then make a back-annotated netlist using netgen and you
will see that the simulation model has the init signal
logically OR'ed with a signal called GSR, located in the
glbl.v file that you are supposed to use during simulation
of back-annotated designs.
If you code stuff like:
reg [1:0] myotherflop;
always @(posedge clk) myotherflop <= two_bit_whatever;
You have just inferred two generic D flip flops, probably
FD components, and even though you don't have an asynchronous
user control on this, it will get initialized once at the
end of configuration, by the GSR signal. I believe FD will
default to 0, unless you specify otherwise.
If you repeat the exercise using netgen, you will see that
GSR is still used as an async reset, but there's no other
signal OR'ed with it.
the "initialization state" of the flip flop when they also change
it's sense -- otherwise the transformation is not really
transparent... (I would argue it's wrong)
Eric
I hope someone will correct me if I'm wrong on this...
For Xilinx FPGAs, all SLICE flip flops (and some other
synchronous elements, too, like BlockRAM output registers,
IOB flops, etc...) are initialized to a known state at
the end of configuration by an internal, chip-wide async
reset called GSR, or "global set/reset". It also happens
to be the case that there's another signal, GTS, or "global
three-state" that forces all I/O to be three-stated during
configuration. These signals are not "visible" in the FPGA
Editor view of the part at any place other than the STARTUP
component.
If you instantiate specific primitives, like FDC or FDP,
you are also making a request on how you want these to be
initialized by GSR (regardless of your use of an additional,
async user reset). FDC initializes to 0. FDP initializes
to 1.
If you code stuff like:
reg [1:0] myflop;
always @(posedge clk or posedge init)
begin
if (init) myflop <= 2'b10;
else myflop <= two_bit_whatever;
end
You have just inferred an FDC and and FDP, both of which are
initialized by GSR at configuration, and both of which also
have an asynchronous user control called "init".
For a more detailed look, try implementing the code above,
and then make a back-annotated netlist using netgen and you
will see that the simulation model has the init signal
logically OR'ed with a signal called GSR, located in the
glbl.v file that you are supposed to use during simulation
of back-annotated designs.
If you code stuff like:
reg [1:0] myotherflop;
always @(posedge clk) myotherflop <= two_bit_whatever;
You have just inferred two generic D flip flops, probably
FD components, and even though you don't have an asynchronous
user control on this, it will get initialized once at the
end of configuration, by the GSR signal. I believe FD will
default to 0, unless you specify otherwise.
If you repeat the exercise using netgen, you will see that
GSR is still used as an async reset, but there's no other
signal OR'ed with it.
I would hope anyone doing this transformation would also changeThe synthesis often moves inverters around, and many signals,
including ones through FF's, are actually the inverse of the
expected signal.
the "initialization state" of the flip flop when they also change
it's sense -- otherwise the transformation is not really
transparent... (I would argue it's wrong)
Eric