Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
I am trying to simulate the code for dct 8*8 which i found , i created a testbench an gave a set of inputs but i am not able to get the output. I am attaching the code and the testbench i used,
Quick answer... You are not asserting reset. For an actual FPGA this MIGHT be OK, but for simulation it will cause Xs in the module and this will stop it from working. In the example I included below, output could be OK since as soon as a clock occurs output gets set to 0. But output will never get set to 1 since "xxx" (the value of count without reset) + "001" will be equal "xxx". And "xxx" will never be equal to "111".
That's it. Modelsim (and I'm guessing other simulators) will propagate uninitialized values.
PS - in synthesis this will work since count will either be turned on as 0s or 1s, and even IF they were "uninitialized and random" the 3 bits of count can still ONLY be 0s or 1s. There is no such thing as Xs in a synthesized FPGA.
Simple example:
signal output : std_logic;
signal count : std_logic_vector(2 downto 0);
if(rst = '1') then
output <= 0;
count <= 0;
elsif(rising_edge(clk)) then
output <= 0;
count <= count + "001";
if(count = "111") then
output <= 1;
end if
end if
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.