Inferring SRLs with INIT value

Synplify now reads the defparam 'INIT' used for instantiated SRLs, so you can initialize the value of the SRL16 for both simulation and synthesis with a single defparam. However, I'm wondering if there is a way to infer SRL16 Johnson rings or shift registers with an initial value. This can be done with registers by setting the 'reset' value of the register to the desired value, but you can't have a reset clause with SRLs or they won't get inferred as SRLs. It would be nice to be able to infer a Johnson ring because if you want to instantiate SRLs you need to instantiate one for each 16 bits of the register which makes it hard to parameterize it.

Reply to
Kevin Neilson
Loading thread data ...

I also have another question: I put a register on the output of the SRL to register the output. I assumed that the register would be placed in the same slice as the SRL, but the placer puts them in different CLBs. Why would it do that? -Kevin

Reply to
Kevin Neilson

No, you pretty much have to instance the SRLs to take advantage of putting the inits on them. You might be able to do it from the UCF (I never tried that), but that makes the simulation not match the hardware. That said, be careful using just the SRL as a johnson counter, because there is no way to reset it other than reconfiguration...ie, it won't recover from an upset. Ken Chapman kind of glosses over that fact in his dissertation on SRL16's.

Probably doing that because you're using the reset on the register. The reset pin is not available if you are using the SRL in the same half-slice.

--
--Ray Andraka, P.E.
President, the Andraka Consulting Group, Inc.
 Click to see the full signature
Reply to
Ray Andraka

I didn't know that about the SRL--I guess I can leave the reset off of the flop. It seems weird to do so but I guess it won't hurt anything. How does the synthesizer know what the initial state is if there is no reset clause?

-Kevin

Reply to
Kevin Neilson

The synthesizer doesn't 'know' the initial state. The initial state defaults to '0' in Xilinx. In order to change that to a '1' you either need an explicit (pre)set on the flip-flop (which you can't do if it is to share a slice half with an SRL16), or you need to put an INIT=S attribute on the flip-flop. That, I think, still requires the ff to be instantiated rather than inferred.

--
--Ray Andraka, P.E.
President, the Andraka Consulting Group, Inc.
 Click to see the full signature
Reply to
Ray Andraka

SRLs, so

there is

initial

value

the

(I

kind

The

half-slice.

of

anything.

no

Howdy Kevin,

To summarize what Ray said: the tools will see and use the INIT clause, but you may have to instantiate the SRL in order to use the INIT. And after the FPGA is loaded and running, there is no way to re-initialize the SRL without reloading the whole part - UNLESS you put a special reset circuit in front of your SRL to shift in a known value... which might take up more resources than keeping the shift register in flops to begin with.

Have fun,

Marc

Reply to
Marc Randolph

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.