Skip to content

Commit

Permalink
Merge pull request #27 from olofk/bootrom_fix
Browse files Browse the repository at this point in the history
Make boot ROM contents configurable through top-level parameter
  • Loading branch information
sam-falvo committed Dec 13, 2016
2 parents 1ca7480 + 6e9c009 commit 764f849
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions processor/docs/example/computer.v
@@ -1,6 +1,9 @@
`timescale 1ns / 1ps

module computer(
module computer #(
parameter bootrom_file = "example.hex"
)
(
`ifdef VERILATOR
input clk,
input reset
Expand Down Expand Up @@ -123,7 +126,7 @@ module computer(
.wb_dat_o()
);

rom rom(
rom #(.bootrom_file(bootrom_file)) rom(
.A(xadr[11:3]),
.Q(romQ),
.STB(STB)
Expand Down
7 changes: 5 additions & 2 deletions processor/docs/example/rom.v
@@ -1,6 +1,9 @@
`timescale 1ns / 1ps

module rom(
module rom #(
parameter bootrom_file = ""
)
(
input [11:3] A, // Address
output [63:0] Q, // Data output
input STB // True if ROM is being accessed.
Expand All @@ -10,7 +13,7 @@ module rom(
assign Q = STB ? results : 0;

initial begin
$readmemh("example.hex", contents);
$readmemh(bootrom_file, contents);
end
endmodule

0 comments on commit 764f849

Please sign in to comment.