- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm programming a FIR Filter in VHDL and I want to insert stuck on errors in the taps.. so, I did this:
SIGNAL tap0, tap1, tap2, tap3 : INTEGER :=0 ;
SIGNAL error : INTEGER :=0; -- other problem if I don't initialize them with "0", the test bench won't run.
SIGNAL tap3std : std_logic_vector(to_unsigned(tap3, 8));
SIGNAL tap_error : to_integer(unsigned(std_logic_vector(to_unsigned(error, 8)) or tap3std));
p1 : process
begin
--here I put the equations for the FIR Filter, it works perfectly if I don't try to put any errors.
end process;
In the test bench I change the values in the taps and everything, but when I look the results, the tap3 signal works properly... but the tap3std is only zeros. :confused: Does anyone know how to fix this? Thank you, Helder. :)
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- SIGNAL tap3std : std_logic_vector(to_unsigned(tap3, 8)); --- Quote End --- In the declaration you should give the size of the vector, not the initial value: SIGNAL tap3std : std_logic_vector(15 downto 0); In this example tap3std has 16 bits. You can give an initial value to a signal that is a register. The only exception are the testbenches where you can do that. This initial value is assigned in the reset condition: process(clk) begin if( rst = '1' ) then tap3std <= std_logic_vector(to_unsigned(.... elsif( clk'event and ....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
instead of posting just a snippet, which is riddled with errors, why not post the real code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, hi!
I solved the problem! You're right, Tricky, I'm sorry for that. My problem was that I declared the "tap_error" signal outside of the architecture, not only out of the process. It made the signal work as a constant. Now that I changed it, it works. Thank you, guys!
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