VHDL testbench

OP #2742899
Rate this post
useful
not useful
hello friends,

I'm having problem while doing my testbench coding.
there is no error when check the syntax but my testbench input for clock 
and data input show the '0' waveform..it means no pulse..i edit my clock 
time but it also not work.
maybe i must do looping for the 'datain' process but i don't know.

i hope u guys will help me to solve this problem.
i'm really appreciate it.thanx..
Attached files:
Moderator (Company: Titel) #2743023
Rate this post
useful
not useful
You are not simulating the testbench. Your top module is obviuosly a 
module called "par_encoder". At the blue bar in your screenshot there 
should be the "par_encoder_TB"...

> Attached files:
>    NEW_PARENCOD_TB.txt (2 KB, 0 downloads)
Pls attach *.vhd files, not *.txt files.
Then you will see some little magic called "syntax highlighting".
Guest #2743083
Rate this post
useful
not useful
Ok. Let's try it with Modelsim:
1
~/par_testbench$ vlib work
2
bl5599@fwfi34:~/test/par_testbench$ vcom par_encoder.vhd
3
Model Technology ModelSim PE vcom 10.1 Compiler 2011.12 Dec  6 2011
4
-- Loading package STANDARD
5
-- Loading package TEXTIO
6
-- Loading package std_logic_1164
7
-- Compiling entity par_encoder
8
-- Compiling architecture Behavioral of par_encoder
9
~/par_testbench$ vcom par_encoder_TB.vhd
10
Model Technology ModelSim PE vcom 10.1 Compiler 2011.12 Dec  6 2011
11
-- Loading package STANDARD
12
-- Loading package TEXTIO
13
-- Loading package std_logic_1164
14
-- Compiling entity par_encoder_TB
15
-- Compiling architecture behavioral of par_encoder_TB
16
###### par_encoder_TB.vhd(42):             CLK1 : STD_LOGIC;
17
** Error: par_encoder_TB.vhd(42): near "CLK1": expecting BEGIN
Your testbench code didn't compile...
One edit later...
1
~/par_testbench$ vcom par_encoder_TB.vhd
2
Model Technology ModelSim PE vcom 10.1 Compiler 2011.12 Dec  6 2011
3
-- Loading package STANDARD
4
-- Loading package TEXTIO
5
-- Loading package std_logic_1164
6
-- Compiling entity par_encoder_TB
7
-- Compiling architecture behavioral of par_encoder_TB
8
###### par_encoder_TB.vhd(56):  variable I=NATURAL;
9
** Error: par_encoder_TB.vhd(56): near "=": expecting ':'
10
###### par_encoder_TB.vhd(115): END behavioral;
11
** Error: par_encoder_TB.vhd(115): VHDL Compiler exiting
One more edit...
1
~/par_testbench$ vcom par_encoder_TB.vhd
2
Model Technology ModelSim PE vcom 10.1 Compiler 2011.12 Dec  6 2011
3
-- Loading package STANDARD
4
-- Loading package TEXTIO
5
-- Loading package std_logic_1164
6
-- Compiling entity par_encoder_TB
7
-- Compiling architecture behavioral of par_encoder_TB
Looks good. Next step: fire up the simulator.
1
~/par_testbench$ vsim -gui par_encoder_TB
2

3
VSIM 1> add wave *
4
VSIM 2> run 1 ms
See results above.

Duke
Attached files:
Moderator (Company: Titel) #2743294
Rate this post
useful
not useful
Waht are those two clocks in your design?

Are they coming from independent sources (e.g. 10MHz and 25MHz)?
Then you will encounter major problems, because there are various VERY 
BIG design flaws in your code:
1
PARITY_EN: process (CLK1,CLK2)
2
  if (CLK1'event and CLK1='1')then 
3
     ...
4
  end if;
5

6
  if (CLK2'event and CLK2='1')then
7
     ...
8
  end if;
9
end process;
A two-clock-process, whow!
Where did you get this coding style from?
With some luck you will get it synthesized for real hardware (maybe).
But if so, you will likely encounter significant problem due to passing 
values across clock domain barriers without any synchronisation.

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now