Hi,
I am want to declare a port for memory array which is constructed
using flip-flops.
For example:
module test_mode( clk, address, input_bus, mem_out)
input enable;
input [3:0] address;
input [7:0] input_bus;
output [7:0] mem_out [0:15];
reg [7:0] mem_out [0:15];
always @ (posedge clk )
begin
mem_out[address] <= input_bus;
end
endmodule
Please suggest the proper syntax for the synthesizable code.
Regards,
Atul
|
|
0
|
|
|
|
Reply
|
atul.ee (21)
|
2/3/2010 9:20:42 AM |
|
On Feb 3, 4:20=A0am, "Atul.ee" <atul...@gmail.com> wrote:
> Hi,
> I am want to declare a port for memory array which is constructed
> using flip-flops.
> For example:
>
> module test_mode( clk, address, input_bus, mem_out)
>
> input enable;
> input [3:0] address;
> input [7:0] input_bus;
> output [7:0] mem_out [0:15];
>
> reg [7:0] mem_out [0:15];
>
> always @ (posedge clk )
> begin
> mem_out[address] <=3D input_bus;
> end
>
> endmodule
>
> Please suggest the proper syntax for the synthesizable code.
>
> Regards,
> Atul
For Verilog and Verilog2001, there is no syntax. There is no support
for arrays as I/O.
Can anyone comment on SystemVerilog? And is SystemVerilog an option
for you?
|
|
0
|
|
|
|
Reply
|
John_H
|
2/3/2010 3:06:06 PM
|
|
On Wed, 3 Feb 2010 07:06:06 -0800 (PST), John_H wrote:
>For Verilog and Verilog2001, there is no syntax. There is no support
>for arrays as I/O.
>
>Can anyone comment on SystemVerilog? And is SystemVerilog an option
>for you?
See my post in today's earlier thread
"concatenation with a for loop".
--
Jonathan Bromley
|
|
0
|
|
|
|
Reply
|
Jonathan
|
2/3/2010 4:43:37 PM
|
|
On Wed, 3 Feb 2010 01:20:42 -0800 (PST), "Atul.ee" <atul.ee@gmail.com>
wrote:
>Hi,
>I am want to declare a port for memory array which is constructed
>using flip-flops.
>For example:
>
>module test_mode( clk, address, input_bus, mem_out)
>
>input enable;
>input [3:0] address;
>input [7:0] input_bus;
>output [7:0] mem_out [0:15];
>
>reg [7:0] mem_out [0:15];
>
>always @ (posedge clk )
>begin
>mem_out[address] <= input_bus;
>end
>
>endmodule
>
>
>Please suggest the proper syntax for the synthesizable code.
>
>Regards,
>Atul
From your code, it's not clear whether you want an "addressable"
entity (suggested by your input address and array operation in the
always block) or access to all the memory simultaneously (suggested by
your mem_out declaration). Perhaps you mean the following:
module test_mode( clk, enable, address, input_bus, mem_out)
input enable;
input [3:0] address;
input [7:0] input_bus;
output [7:0] mem_out;
reg [7:0] memory [0:15];
assign mem_out = memory[address];
always @ (posedge clk )
begin
if (enable) memory[address] <= input_bus;
end
endmodule
If you really want full access to all the memory you'll need to define
a 128 bit output into which you need to slice externally.
ie
output [127:0] mem_out;
assign mem_out = {memory[15], memory[14], ...};
--
Muzaffer Kal
DSPIA INC.
ASIC/FPGA Design Services
http://www.dspia.com
|
|
0
|
|
|
|
Reply
|
Muzaffer
|
2/3/2010 11:55:01 PM
|
|
|
3 Replies
1692 Views
(page loaded in 0.063 seconds)
Similiar Articles: Port declaration for a memory array - comp.lang.verilogHi, I am want to declare a port for memory array which is constructed using flip-flops. For example: module test_mode( clk, address, input_bus, ... sign extension in verilog - comp.lang.verilogPort declaration for a memory array - comp.lang.verilog sign extension in verilog - comp.lang.verilog Just to clarify, this is an extension and not part of the ... looping through array in gas - comp.lang.asm.x86Port declaration for a memory array - comp.lang.verilog looping through array in gas - comp.lang.asm.x86... delorie.com ... On memory ... function declaration: array ... return multiple outputs for function - comp.soft-sys.matlab ...Port declaration for a memory array - comp.lang.verilog Unpacking a cell array into multiple variables - comp.soft-sys ... function declaration: array output variables ... f77 and dynamic arrays in common blocks - comp.lang.fortran ...Port declaration for a memory array - comp.lang.verilog f77 and dynamic arrays in common blocks - comp.lang.fortran ..... after a fashion, is included in the PORT ... Verilog tutorial by John Sanguinetti - comp.arch.fpgaPort declaration for a memory array - comp.lang.verilog Verilog tutorial by John Sanguinetti - comp.arch.fpga Port declaration for a memory array - comp.lang.verilog ... required help regarding verilog - comp.lang.verilogPort declaration for a memory array - comp.lang.verilog > > Regards, > Atul For Verilog and Verilog2001, there is no syntax. There is no support for arrays as I/O. Concatenate from a for loop - comp.soft-sys.matlabPort declaration for a memory array - comp.lang.verilog And is SystemVerilog an option >for you? See my post in today's earlier thread "concatenation with a for loop". concatenation with a for loop - comp.lang.verilogPort declaration for a memory array - comp.lang.verilog And is SystemVerilog an option >for you? See my post in today's earlier thread "concatenation with a for loop". How to use a Ram. - comp.lang.verilog... the moment I want to store this 48 bit inside an array ... is the description of my istantiated block: memory ... and probably it has something to do with the declaration of ... Port declaration for a memory array - comp.lang.verilog | Computer ...Hi, I am want to declare a port for memory array which is constructed using flip-flops. For example: module test_mode( clk, address, input_bus, ... Array DeclarationsStorage of Arrays ... An "array declaration" names the array and specifies the type of its elements. 7/21/2012 4:02:21 AM
|