Skip to content

Commit

Permalink
lm32: fix documentation style
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Walle <michael@walle.cc>
  • Loading branch information
mwalle authored and Sebastien Bourdeauducq committed Nov 14, 2012
1 parent 1fad281 commit c4360b6
Showing 1 changed file with 37 additions and 5 deletions.
42 changes: 37 additions & 5 deletions cores/lm32/rtl/lm32_dp_ram.v
@@ -1,29 +1,61 @@
/////////////////////////////////////////////////////
// Module interface
/////////////////////////////////////////////////////

module lm32_dp_ram(
// ----- Inputs -----
clk_i,
rst_i,
we_i,
waddr_i,
wdata_i,
raddr_i,
rdata_o);
// ----- Outputs -----
rdata_o
);

/////////////////////////////////////////////////////
// Parameters
/////////////////////////////////////////////////////

parameter data_width = 1; // Width of the data ports
parameter addr_width = 1; // Width of the address ports

parameter addr_width = 32;
parameter data_width = 8;
/////////////////////////////////////////////////////
// Inputs
/////////////////////////////////////////////////////

input clk_i;
input rst_i;
input we_i;
input [addr_width-1:0] waddr_i;
input [data_width-1:0] wdata_i;
input [addr_width-1:0] raddr_i;

/////////////////////////////////////////////////////
// Outputs
/////////////////////////////////////////////////////

output [data_width-1:0] rdata_o;

reg [data_width-1:0] mem[(1<<addr_width)-1:0];
/////////////////////////////////////////////////////
// Internal nets and registers
/////////////////////////////////////////////////////

reg [data_width-1:0] mem[(1<<addr_width)-1:0];
reg [addr_width-1:0] raddr_r;

/////////////////////////////////////////////////////
// Combinational logic
/////////////////////////////////////////////////////

assign rdata_o = mem[raddr_r];

always @ (posedge clk_i)
/////////////////////////////////////////////////////
// Sequential logic
/////////////////////////////////////////////////////

always @(posedge clk_i)
begin
if (we_i)
mem[waddr_i] <= wdata_i;
Expand Down

0 comments on commit c4360b6

Please sign in to comment.