P
Peter
Guest
Hello all,
I am a absolute newby trying really hard to grasp this Verilog thing and am
having problems with getting my first simple module to compile and work with
ModelSim II - Starter Xilinx edition.
Here is the module:
module counter(clk, cnt, count);
input clk;
output [3:0]cnt;
output [3:0]count;
reg [3:0]count;
always@(posedge clk)
begin
count <= (count + 1) % 11;
cnt = count;
end
endmodule
When I attempt to compile the above module, it tells me "illegal use of cnt"
in the line <cnt = count;>
If I comment this line out, it compiles OK, but when I test the module using
a clock defined in the ModelSim GUI, the count register does not change it's
starting value from xxxx. I have stepped the simulation and it definately
executes the line where count is supposed to update.
Can anyone give me any hints? (I'm now getting nowhere)
Regards, Peter
I am a absolute newby trying really hard to grasp this Verilog thing and am
having problems with getting my first simple module to compile and work with
ModelSim II - Starter Xilinx edition.
Here is the module:
module counter(clk, cnt, count);
input clk;
output [3:0]cnt;
output [3:0]count;
reg [3:0]count;
always@(posedge clk)
begin
count <= (count + 1) % 11;
cnt = count;
end
endmodule
When I attempt to compile the above module, it tells me "illegal use of cnt"
in the line <cnt = count;>
If I comment this line out, it compiles OK, but when I test the module using
a clock defined in the ModelSim GUI, the count register does not change it's
starting value from xxxx. I have stepped the simulation and it definately
executes the line where count is supposed to update.
Can anyone give me any hints? (I'm now getting nowhere)
Regards, Peter