How to specify the input signal in verilog?

Status
Not open for further replies.

iVenky

Advanced Member level 2
Joined
Jul 11, 2011
Messages
584
Helped
37
Reputation
76
Reaction score
35
Trophy points
1,318
Location
College Station, Texas
Activity points
6,124
Hello I am new to modelsim and Verilog.
Here's the code for a simple d f/f


LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY dff IS
PORT ( d, clk, rst: IN STD_LOGIC;
q: OUT STD_LOGIC);
END dff;
ARCHITECTURE behavior OF dff IS
BEGIN
PROCESS (rst, clk)
BEGIN
IF( rst='1') THEN
q<='0';
ELSIF (clk 'EVENT AND clk='1') THEN
q<=d;
END IF;
END PROCESS;
END behavior;



I want to specify the input for each of the input and find the corresponding output. I opened the Wave window in Modelsim but as I didn't give any input nothing was displayed in the output. How to give the input values??

Thanks in advance.
 

This is not Verilog, it is VHDL.

You need to write a testbench that instantiates this code and then drive the inputs from the testbench,
 

This is not Verilog, it is VHDL.

You need to write a testbench that instantiates this code and then drive the inputs from the testbench,

Oops I thought there is no difference between verilog and VHDL. Anyway thanks.

How to drive the inputs from the testbench?
What are the steps involved in modelsim?


Thanks........
 
Last edited:

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…