Hey guys
I've been having problems with my code.
I'm trying to create a FSM with the following modules, each in a
separate source file:
module ClockCounter(
input clk,
input rst,
output clk_en
);
reg [24:0] clk_count;
always @ (posedge clk, posedge rst)
begin
if (rst) clk_count <= 0;
else clk_count <= clk_count+'b1;
end
assign clk_en = &clk_count;
endmodule
module OutputLogic(
input [2:0] S,
output reg LA, LB, LC, RA, RB, RC
);
always @ ( * )
begin
LA <= ~S[0] & S[1] & S[2] | S[0] & S[1] & ~S[2] | S[0] & ~S[1] & S[2];
LB <= S[0] & S[1] & ~S[2] | S[0] & ~S[1] & S[2];
LC <= S[0] & ~S[1] & S[2];
RA <= ~S[0] & ~S[1] & S[2] | ~S[0] & S[1] & ~S[2] | S[0] & ~S[1] &
~S[2];
RB <= ~S[0] & S[1] & ~S[2] | S[0] & ~S[1] & ~S[2];
RC <= S[0] & S[1] & ~S[2];
end
endmodule
module StateHoldingRegister(
input [2:0] SN,
input CLK,
output reg [2:0] S
);
always @ (posedge CLK)
S <= SN;
endmodule
module NextStateLogic(
input [2:0] S,
input L,
input R,
output reg [2:0] SN
);
always @ ( * )
begin
SN [0] <= ~S[0] & S[1] | S[1] & ~S[2];
SN [1] <= S[0] & S[1] & S[2] & L & ~R | ~S[0] & S[2];
SN [2] <= ~S[0] & ~S[1] & ~S[2] & ~L & R | ~S[0] & ~S[1] & ~S[2] & L &
~R | S[0] & S[1] & ~S[2];
end
endmodule
I have no idea how to connect them via verilog, so I created a schematic
symbol for each and connected them via a new schematic source file.
However, I get this error:
ERROR:HDLCompilers:91 - "Thunderbird.vf" line 53 Module
'NextStateLogic_MUSER_Thunderbird' does not have a port named 'L'
ERROR:HDLCompilers:91 - "Thunderbird.vf" line 54 Module
'NextStateLogic_MUSER_Thunderbird' does not have a port named 'R'
ERROR:HDLCompilers:91 - "Thunderbird.vf" line 55 Module
'NextStateLogic_MUSER_Thunderbird' does not have a port named 'S'
ERROR:HDLCompilers:91 - "Thunderbird.vf" line 56 Module
'NextStateLogic_MUSER_Thunderbird' does not have a port named 'SN'
My question to you guys is, what's my mistake? How can I connect the
modules through verilog?
Regards