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.

ERROR:HDLCompilers:27 - "da.v" line 12 Illegal redeclaration of 'dout1'

Status
Not open for further replies.

darshankumar

Newbie level 6
Joined
Feb 15, 2012
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,468
Code:
`timescale 1ns / 1ps
module sd(input clk,input en,
                 input [7:0] din1,
                 input [7:0] addr1,
					  input  we,
                 output   [7:0] dout1                                                   
                );  
    parameter RAM_WIDTH =8;
   parameter RAM_ADDR_BITS = 8;
   
 reg [RAM_WIDTH-1:0] bram [(2**RAM_ADDR_BITS)-1:0];
wire[7:0] dout1;
   always @(posedge clk)
      if (en) begin
         if (we)
            bram[addr1] <= din1;
				dout1 <= bram[addr1];
				end
		bram bram1(.clk(clk),
		.we(we),
		.din(din1),
		.addr(addr1),
		.en(en),
		.dout(dout1)
		);
	endmodule

help me out i am getting this error please
 
Last edited by a moderator:

output [7:0] dout1

dout1 <= bram[addr1];

.dout(dout1)

What is that?. You are trying to read the output IO register which is not possible. You should do something like this
Code:
wire[7:0] dout1_reg;
dout1 <= bram[addr1];
dout1_reg <= bram[addr1];

.dout(dout1_reg);

You create an immediate net for output driver and then read that net. This is meaningful.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top