Line 1... |
Line 1... |
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
//
|
//
|
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
|
|
|
|
module soc_boot(
|
module soc_boot
|
|
(
|
input [31:0] mem_data_i,
|
input [31:0] mem_data_i,
|
output [31:0] mem_data_o,
|
output [31:0] mem_data_o,
|
input [31:0] mem_addr_i,
|
input [31:0] mem_addr_i,
|
input [3:0] mem_sel_i,
|
input [3:0] mem_sel_i,
|
input mem_we_i,
|
input mem_we_i,
|
Line 19... |
Line 20... |
|
|
input mem_clk_i,
|
input mem_clk_i,
|
input mem_rst_i
|
input mem_rst_i
|
);
|
);
|
|
|
parameter BOOT_VECTOR_FILE = "../../../../or1200_soc/sw/load_this_to_ram/boot_vector_rom.txt";
|
parameter USE_BOOT_ROM_0 = 1;
|
parameter BOOT_ROM_0_FILE = "../../../../or1200_soc/sw/load_this_to_ram/boot_rom_0.txt";
|
// parameter BOOT_ROM_0_FILE = "../../../../../sw/load_this_to_ram/boot_rom_0.txt";
|
parameter BOOT_ROM_0_DEPTH = 8;
|
parameter BOOT_ROM_0_DEPTH = 8;
|
parameter BOOT_ROM_1_FILE = "../../../../or1200_soc/sw/load_this_to_ram/boot_rom_1.txt";
|
|
parameter BOOT_ROM_1_DEPTH = 15;
|
parameter USE_BOOT_ROM_1 = 0;
|
|
// parameter BOOT_ROM_1_FILE = "../../../../../sw/load_this_to_ram/boot_rom_1.txt";
|
|
// parameter BOOT_ROM_1_DEPTH = 15;
|
|
parameter BOOT_ROM_1_DEPTH = 0;
|
|
|
|
parameter USE_BOOT_ROM_2 = 0;
|
parameter BOOT_ROM_2_FILE = 0;
|
parameter BOOT_ROM_2_FILE = 0;
|
parameter BOOT_ROM_2_DEPTH = 0;
|
parameter BOOT_ROM_2_DEPTH = 0;
|
|
|
//---------------------------------------------------
|
//---------------------------------------------------
|
// slave muxes
|
// slave muxes
|
Line 65... |
Line 71... |
|
|
//---------------------------------------------------
|
//---------------------------------------------------
|
// boot_vector_rom
|
// boot_vector_rom
|
wire slave_0_we_i = mem_we_i & (slave_select == 2'b00);
|
wire slave_0_we_i = mem_we_i & (slave_select == 2'b00);
|
|
|
soc_ram #( .DATA_WIDTH(32), .ADDR_WIDTH(2),
|
boot_vector_rom #( .DATA_WIDTH(32), .ADDR_WIDTH(2) )
|
.MEM_INIT(BOOT_VECTOR_FILE) )
|
|
i_boot_vector_rom (
|
i_boot_vector_rom (
|
.data(mem_data_i),
|
.data(mem_data_i),
|
.addr( mem_addr_i[3:2] ),
|
.addr( mem_addr_i[3:2] ),
|
.we(slave_0_we_i),
|
.we(slave_0_we_i),
|
.clk(~mem_clk_i),
|
.clk(~mem_clk_i),
|
Line 80... |
Line 85... |
//---------------------------------------------------
|
//---------------------------------------------------
|
// boot_rom_0
|
// boot_rom_0
|
wire slave_1_we_i = mem_we_i & (slave_select == 2'b01);
|
wire slave_1_we_i = mem_we_i & (slave_select == 2'b01);
|
|
|
generate
|
generate
|
if( BOOT_ROM_0_FILE )
|
if( USE_BOOT_ROM_0 )
|
soc_ram #( .DATA_WIDTH(32), .ADDR_WIDTH(BOOT_ROM_0_DEPTH) ,
|
boot_rom_0 #( .DATA_WIDTH(32), .ADDR_WIDTH(BOOT_ROM_0_DEPTH) )
|
.MEM_INIT(BOOT_ROM_0_FILE) )
|
|
i_boot_rom_0 (
|
i_boot_rom_0 (
|
.data(mem_data_i),
|
.data(mem_data_i),
|
.addr( mem_addr_i[(BOOT_ROM_0_DEPTH + 1):2] ),
|
.addr( mem_addr_i[(BOOT_ROM_0_DEPTH + 1):2] ),
|
.we(slave_1_we_i),
|
.we(slave_1_we_i),
|
.clk(~mem_clk_i),
|
.clk(~mem_clk_i),
|
Line 99... |
Line 103... |
//---------------------------------------------------
|
//---------------------------------------------------
|
// boot_rom_1
|
// boot_rom_1
|
wire slave_2_we_i = mem_we_i & (slave_select == 2'b10);
|
wire slave_2_we_i = mem_we_i & (slave_select == 2'b10);
|
|
|
generate
|
generate
|
if( BOOT_ROM_1_FILE )
|
if( USE_BOOT_ROM_1 )
|
soc_ram #( .DATA_WIDTH(32), .ADDR_WIDTH(BOOT_ROM_1_DEPTH),
|
boot_rom_1 #( .DATA_WIDTH(32), .ADDR_WIDTH(BOOT_ROM_1_DEPTH) )
|
.MEM_INIT(BOOT_ROM_1_FILE) )
|
|
i_boot_rom_1 (
|
i_boot_rom_1 (
|
.data(mem_data_i),
|
.data(mem_data_i),
|
.addr( mem_addr_i[(BOOT_ROM_1_DEPTH + 1):2] ),
|
.addr( mem_addr_i[(BOOT_ROM_1_DEPTH + 1):2] ),
|
.we(slave_2_we_i),
|
.we(slave_2_we_i),
|
.clk(~mem_clk_i),
|
.clk(~mem_clk_i),
|
Line 118... |
Line 121... |
//---------------------------------------------------
|
//---------------------------------------------------
|
// boot_rom_2
|
// boot_rom_2
|
wire slave_3_we_i = mem_we_i & (slave_select == 2'b11);
|
wire slave_3_we_i = mem_we_i & (slave_select == 2'b11);
|
|
|
generate
|
generate
|
if( BOOT_ROM_2_FILE )
|
if( USE_BOOT_ROM_2 )
|
soc_ram #( .DATA_WIDTH(32), .ADDR_WIDTH(BOOT_ROM_2_DEPTH),
|
boot_rom_2 #( .DATA_WIDTH(32), .ADDR_WIDTH(BOOT_ROM_2_DEPTH) )
|
.MEM_INIT(BOOT_ROM_2_FILE) )
|
|
i_boot_rom_2 (
|
i_boot_rom_2 (
|
.data(mem_data_i),
|
.data(mem_data_i),
|
.addr( mem_addr_i[(BOOT_ROM_2_DEPTH + 1):2] ),
|
.addr( mem_addr_i[(BOOT_ROM_2_DEPTH + 1):2] ),
|
.we(slave_3_we_i),
|
.we(slave_3_we_i),
|
.clk(~mem_clk_i),
|
.clk(~mem_clk_i),
|