Continue to Site

Welcome to EDAboard.com

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.

Simulation using modelSim

Status
Not open for further replies.

Elnegm

Member level 1
Joined
Jun 28, 2005
Messages
33
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,524
Hi
I'm abeginner with verilog and i use FPGA advantage and modelSim
when i want to simulate the following code output counte give me unknown
Is there is setting in ModelSim i have to set in order to simulate correctly?
Code:
module firstseq (clk, reset, enable, count);
input clk, reset, enable;
output [3:0] count;
reg [3:0] count;
always @ (negedge clk)
if (reset == 1'b1)
count <= 0;
else if ( enable == 1'b1)
count <= count + 1;
endmodule
 

Not realy. All you need to do: do the tutorial execise (it is comming with you modelsim instalation) and you will figure out what to do


regards,
 

Just force the value desired in put and u can see the response.. Go to edit tab in signals window and force 1 or 0 in that place and run u will get the response.. for clk there is a seperate force value for clock in the edit tab...

nothing to do with the settignsg
 

To simulate this code you have to procedures:
1- Create a verilog test bench to stimulate the inputs
2- Use "force" commands from ModelSim to put your module in action
 

it's exactly like yasser said
but i would advice forcing signals cause the design is simple
also try to begin by reseting the circuit
and be sure that the clock frequency is chosen correctly in comparison with ur other signals
 

Write TB
module firstseq_tb ;
reg clk, reset, enable;
wire [3:0] count;
firstseq d1(clk, reset, enable, count);
always
#2 clk =~clk;
initial clk=0;
initial
begin
enable =1'b1; reset=0;
#4 reset=1'b1;
#and so on.........
end
endmodule
Thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top