R
rickman
Guest
It has been awhile since I coded up any VHDL and there are some things
I have forgotten. One of them is how to infer the GSR state of a
register. What I remember is that you use an async reset on all
registers and specify the state in an assignment in that part of the
if statement. But I have always had an external reset to use as the
controlling signal for the reset state. What do you use if you have
no external reset and only want to specify the reset state for the
power on reset?
Here is code I am currently using.
GSR <= not Switch(5);
SysReset <= SysRst(0);
SysRstReg: process (GenClk, GSR) begin
if (GSR = '1') then
SysRst <= "1111";
elsif (rising_edge(GenClk)) then
SysRst <= '0' & SysRst(3 downto 1);
end if;
end process SysRstReg;
But if I don't have the input Switch(5), what do I specify? This is
for a Lattice part which should be very similar to the Xilinix parts
since they share the same hardware and software roots. I have dug all
through the Lattice docs and found lots of info on how to *control*
the GSR/PUR signal, but not on how to *use* the GSR signal.
Rick
I have forgotten. One of them is how to infer the GSR state of a
register. What I remember is that you use an async reset on all
registers and specify the state in an assignment in that part of the
if statement. But I have always had an external reset to use as the
controlling signal for the reset state. What do you use if you have
no external reset and only want to specify the reset state for the
power on reset?
Here is code I am currently using.
GSR <= not Switch(5);
SysReset <= SysRst(0);
SysRstReg: process (GenClk, GSR) begin
if (GSR = '1') then
SysRst <= "1111";
elsif (rising_edge(GenClk)) then
SysRst <= '0' & SysRst(3 downto 1);
end if;
end process SysRstReg;
But if I don't have the input Switch(5), what do I specify? This is
for a Lattice part which should be very similar to the Xilinix parts
since they share the same hardware and software roots. I have dug all
through the Lattice docs and found lots of info on how to *control*
the GSR/PUR signal, but not on how to *use* the GSR signal.
Rick