D
deep
Guest
Could any explain the following:
Synthesis of following code doesnot generate any component for var3, but
will the code generate a latch or flipflop for var1 and var2 ?
Deep
....
signal s1,s2,s3,s4 : std_logic;
begin
process(clk, rst)
variable var1, var2,var3,var4 : std_logic;
begin
if rst='1' then
var1:='0' ; var2:='0';
elsif(clk'event and clk='1') then
var1:=s1;
var2:=s2;
s3<= var1 xor var2;
var3:= s3 xor s4;
s4<=var3;
end if;
end process;
...
Synthesis of following code doesnot generate any component for var3, but
will the code generate a latch or flipflop for var1 and var2 ?
Deep
....
signal s1,s2,s3,s4 : std_logic;
begin
process(clk, rst)
variable var1, var2,var3,var4 : std_logic;
begin
if rst='1' then
var1:='0' ; var2:='0';
elsif(clk'event and clk='1') then
var1:=s1;
var2:=s2;
s3<= var1 xor var2;
var3:= s3 xor s4;
s4<=var3;
end if;
end process;
...