- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a VHDL code for process as below:
process (vin_clk) begin
if rising_edge(vin_clk) then
if (rst_n = '0') then
data_cnt <= "000000000000";
elsif (frame_flag_vin = '1') then
data_cnt <= "000000000000";
elsif (vin_de = '1') then
if (data_cnt = vin_width - "000000000001") then
data_cnt <= "000000000000";
else
data_cnt <= data_cnt + "000000000001";
end if;
else
data_cnt <= data_cnt;
end if;
end if;
end process;
My question is: if to delete the last "else" branch (data_cnt <= data_cnt;), what will the difference be? or no difference?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's the same. See the RTL view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No difference, because all signals hold their value in VHDL anyway.
If you did it without a clock, it would also make no difference, as either way (with or without the else) you would be inferring a latch. It is usual to leave out anything that occurs implicitly (like the final else branches). What you're asking in the code is for the synthesisor to connect the en port of the inferred register to everything in the if branches.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page