| 1 |
2 |
jamieiles |
// Copyright Jamie Iles, 2017
|
| 2 |
|
|
//
|
| 3 |
|
|
// This file is part of s80x86.
|
| 4 |
|
|
//
|
| 5 |
|
|
// s80x86 is free software: you can redistribute it and/or modify
|
| 6 |
|
|
// it under the terms of the GNU General Public License as published by
|
| 7 |
|
|
// the Free Software Foundation, either version 3 of the License, or
|
| 8 |
|
|
// (at your option) any later version.
|
| 9 |
|
|
//
|
| 10 |
|
|
// s80x86 is distributed in the hope that it will be useful,
|
| 11 |
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 12 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 13 |
|
|
// GNU General Public License for more details.
|
| 14 |
|
|
//
|
| 15 |
|
|
// You should have received a copy of the GNU General Public License
|
| 16 |
|
|
// along with s80x86. If not, see .
|
| 17 |
|
|
|
| 18 |
|
|
module BIOS #(parameter depth = 32)
|
| 19 |
|
|
(input logic clk,
|
| 20 |
|
|
input logic cs,
|
| 21 |
|
|
input logic data_m_access,
|
| 22 |
|
|
output logic data_m_ack,
|
| 23 |
|
|
input logic [19:1] data_m_addr,
|
| 24 |
|
|
output logic [15:0] data_m_data_out,
|
| 25 |
|
|
input logic [1:0] data_m_bytesel);
|
| 26 |
|
|
|
| 27 |
|
|
wire [15:0] q;
|
| 28 |
|
|
assign data_m_data_out = data_m_ack ? q : 16'b0;
|
| 29 |
|
|
|
| 30 |
|
|
always_ff @(posedge clk)
|
| 31 |
|
|
data_m_ack <= cs & data_m_access;
|
| 32 |
|
|
|
| 33 |
|
|
altsyncram altsyncram_component(.address_a(data_m_addr[$clog2(depth):1]),
|
| 34 |
|
|
.byteena_a(data_m_bytesel),
|
| 35 |
|
|
.clock0(clk),
|
| 36 |
|
|
.data_a(),
|
| 37 |
|
|
.wren_a(1'b0),
|
| 38 |
|
|
.q_a(q),
|
| 39 |
|
|
.aclr0(1'b0),
|
| 40 |
|
|
.aclr1(1'b0),
|
| 41 |
|
|
.address_b(1'b1),
|
| 42 |
|
|
.addressstall_a(1'b0),
|
| 43 |
|
|
.addressstall_b(1'b0),
|
| 44 |
|
|
.byteena_b(1'b1),
|
| 45 |
|
|
.clock1(1'b1),
|
| 46 |
|
|
.clocken0(1'b1),
|
| 47 |
|
|
.clocken1(1'b1),
|
| 48 |
|
|
.clocken2(1'b1),
|
| 49 |
|
|
.clocken3(1'b1),
|
| 50 |
|
|
.data_b(1'b1),
|
| 51 |
|
|
.eccstatus(),
|
| 52 |
|
|
.q_b(),
|
| 53 |
|
|
.rden_a(1'b1),
|
| 54 |
|
|
.rden_b(1'b1),
|
| 55 |
|
|
.wren_b(1'b0));
|
| 56 |
|
|
defparam
|
| 57 |
|
|
altsyncram_component.byte_size = 8,
|
| 58 |
|
|
altsyncram_component.clock_enable_input_a = "BYPASS",
|
| 59 |
|
|
altsyncram_component.clock_enable_output_a = "BYPASS",
|
| 60 |
|
|
altsyncram_component.lpm_hint = "ENABLE_RUNTIME_MOD=NO",
|
| 61 |
|
|
altsyncram_component.lpm_type = "altsyncram",
|
| 62 |
|
|
altsyncram_component.numwords_a = depth,
|
| 63 |
|
|
altsyncram_component.operation_mode = "SINGLE_PORT",
|
| 64 |
|
|
altsyncram_component.outdata_aclr_a = "NONE",
|
| 65 |
|
|
altsyncram_component.outdata_reg_a = "UNREGISTERED",
|
| 66 |
|
|
altsyncram_component.power_up_uninitialized = "FALSE",
|
| 67 |
|
|
altsyncram_component.read_during_write_mode_port_a = "NEW_DATA_NO_NBE_READ",
|
| 68 |
|
|
altsyncram_component.widthad_a = $clog2(depth),
|
| 69 |
|
|
altsyncram_component.width_a = 16,
|
| 70 |
|
|
altsyncram_component.width_byteena_a = 2,
|
| 71 |
|
|
altsyncram_component.init_file = "bios.mif";
|
| 72 |
|
|
|
| 73 |
|
|
endmodule
|