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.

Module replication in verilog

Status
Not open for further replies.

gaut

Newbie level 1
Newbie level 1
Joined
Feb 15, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,290
I wanted to create multiple instances(lets say 100, 1000 and increasing on) of the 8 bit LFSR. I have used the generate statements but I am getting errors. If someone could help with the generate statement syntax:


module top(clock,outpath);
parameter N=100;
input clock;
output [8*N-1:0] outpath;
genvar i;
generate
for (i=0; i<N; i=i+1) begin : lfsr_flops
LFSR8_8E u (clock,outpath[8*i+7:8*i]);
end
endgenerate
endmodule




module LFSR8_8E(clock,q);
input clock;
output [7:0] q;

reg [7:0] LFSR;
wire feedback = LFSR[7];

always @(posedge clock)
begin
LFSR[0] <= feedback;
LFSR[1] <= LFSR[0];
LFSR[2] <= LFSR[1] ^ feedback;
LFSR[3] <= LFSR[2] ^ feedback;
LFSR[4] <= LFSR[3] ^ feedback;
LFSR[5] <= LFSR[4];
LFSR[6] <= LFSR[5];
LFSR[7] <= LFSR[6];
end
 
Last edited:

As we are not in a guessing game, you may want to mention an actual error message. I see that in the LFSR module, q is unconnected, so the synthesized design will reduce to nothing.

Furthermore I don't understand the design purpose because all LSFR instances will have exactly the same output with q connected.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top