Remove references to AHB-Lite, describe buses as (a subset of) AHB5

This commit is contained in:
Luke Wren 2022-08-28 14:15:20 +01:00
parent 7d18a21734
commit bf38d93d33
5 changed files with 102 additions and 102 deletions

View File

@ -268,19 +268,19 @@ hazard3_cpu_1port #(
.clk (clk), .clk (clk),
.rst_n (rst_n_cpu), .rst_n (rst_n_cpu),
.ahblm_haddr (proc_haddr), .haddr (proc_haddr),
.ahblm_hwrite (proc_hwrite), .hwrite (proc_hwrite),
.ahblm_htrans (proc_htrans), .htrans (proc_htrans),
.ahblm_hsize (proc_hsize), .hsize (proc_hsize),
.ahblm_hburst (proc_hburst), .hburst (proc_hburst),
.ahblm_hprot (proc_hprot), .hprot (proc_hprot),
.ahblm_hmastlock (proc_hmastlock), .hmastlock (proc_hmastlock),
.ahblm_hexcl (proc_hexcl), .hexcl (proc_hexcl),
.ahblm_hready (proc_hready), .hready (proc_hready),
.ahblm_hresp (proc_hresp), .hresp (proc_hresp),
.ahblm_hexokay (proc_hexokay), .hexokay (proc_hexokay),
.ahblm_hwdata (proc_hwdata), .hwdata (proc_hwdata),
.ahblm_hrdata (proc_hrdata), .hrdata (proc_hrdata),
.dbg_req_halt (hart_req_halt), .dbg_req_halt (hart_req_halt),
.dbg_req_halt_on_reset (hart_req_halt_on_reset), .dbg_req_halt_on_reset (hart_req_halt_on_reset),

View File

@ -1017,7 +1017,7 @@ always @ (posedge clk or negedge rst_n) begin
xm_wfi <= 1'b0; xm_wfi <= 1'b0;
end end
end else if (bus_dph_err_d) begin end else if (bus_dph_err_d) begin
// First phase of 2-phase AHBL error response. Pass the exception along on // First phase of 2-phase AHB5 error response. Pass the exception along on
// this cycle, and on the next cycle the trap entry will be asserted, // this cycle, and on the next cycle the trap entry will be asserted,
// suppressing any load/store that may currently be in stage X. // suppressing any load/store that may currently be in stage X.
`ifdef HAZARD3_ASSERTIONS `ifdef HAZARD3_ASSERTIONS

View File

@ -5,7 +5,7 @@
// Single-ported top level file for Hazard3 CPU. This file instantiates the // Single-ported top level file for Hazard3 CPU. This file instantiates the
// Hazard3 core, and arbitrates its instruction fetch and load/store signals // Hazard3 core, and arbitrates its instruction fetch and load/store signals
// down to a single AHB-Lite master port. // down to a single AHB5 master port.
`default_nettype none `default_nettype none
@ -20,21 +20,21 @@ module hazard3_cpu_1port #(
`RVFI_OUTPUTS , `RVFI_OUTPUTS ,
`endif `endif
// AHB-lite Master port // AHB5 Master port
output reg [W_ADDR-1:0] ahblm_haddr, output reg [W_ADDR-1:0] haddr,
output reg ahblm_hwrite, output reg hwrite,
output reg [1:0] ahblm_htrans, output reg [1:0] htrans,
output reg [2:0] ahblm_hsize, output reg [2:0] hsize,
output wire [2:0] ahblm_hburst, output wire [2:0] hburst,
output reg [3:0] ahblm_hprot, output reg [3:0] hprot,
output wire ahblm_hmastlock, output wire hmastlock,
output reg [7:0] ahblm_hmaster, output reg [7:0] hmaster,
output reg ahblm_hexcl, output reg hexcl,
input wire ahblm_hready, input wire hready,
input wire ahblm_hresp, input wire hresp,
input wire ahblm_hexokay, input wire hexokay,
output wire [W_DATA-1:0] ahblm_hwdata, output wire [W_DATA-1:0] hwdata,
input wire [W_DATA-1:0] ahblm_hrdata, input wire [W_DATA-1:0] hrdata,
// Debugger run/halt control // Debugger run/halt control
input wire dbg_req_halt, input wire dbg_req_halt,
@ -170,7 +170,7 @@ always @ (posedge clk or negedge rst_n) begin
bus_hold_aph <= 1'b0; bus_hold_aph <= 1'b0;
bus_gnt_ids_prev <= 3'h0; bus_gnt_ids_prev <= 3'h0;
end else begin end else begin
bus_hold_aph <= ahblm_htrans[1] && !ahblm_hready && !ahblm_hresp; bus_hold_aph <= htrans[1] && !hready && !hresp;
bus_gnt_ids_prev <= {bus_gnt_i, bus_gnt_d, bus_gnt_s}; bus_gnt_ids_prev <= {bus_gnt_i, bus_gnt_d, bus_gnt_s};
end end
end end
@ -204,7 +204,7 @@ always @ (posedge clk or negedge rst_n) begin
bus_active_dph_i <= 1'b0; bus_active_dph_i <= 1'b0;
bus_active_dph_d <= 1'b0; bus_active_dph_d <= 1'b0;
bus_active_dph_s <= 1'b0; bus_active_dph_s <= 1'b0;
end else if (ahblm_hready) begin end else if (hready) begin
bus_active_dph_i <= bus_gnt_i; bus_active_dph_i <= bus_gnt_i;
bus_active_dph_d <= bus_gnt_d; bus_active_dph_d <= bus_gnt_d;
bus_active_dph_s <= bus_gnt_s; bus_active_dph_s <= bus_gnt_s;
@ -235,70 +235,70 @@ wire [3:0] hprot_sbus = {
1'b1 // Data access 1'b1 // Data access
}; };
assign ahblm_hburst = 3'b000; // HBURST_SINGLE assign hburst = 3'b000; // HBURST_SINGLE
assign ahblm_hmastlock = 1'b0; assign hmastlock = 1'b0;
always @ (*) begin always @ (*) begin
if (bus_gnt_s) begin if (bus_gnt_s) begin
ahblm_htrans = HTRANS_NSEQ; htrans = HTRANS_NSEQ;
ahblm_hexcl = 1'b0; hexcl = 1'b0;
ahblm_haddr = dbg_sbus_addr; haddr = dbg_sbus_addr;
ahblm_hsize = {1'b0, dbg_sbus_size}; hsize = {1'b0, dbg_sbus_size};
ahblm_hwrite = dbg_sbus_write; hwrite = dbg_sbus_write;
ahblm_hprot = hprot_sbus; hprot = hprot_sbus;
ahblm_hmaster = 8'h01; hmaster = 8'h01;
end else if (bus_gnt_d) begin end else if (bus_gnt_d) begin
ahblm_htrans = HTRANS_NSEQ; htrans = HTRANS_NSEQ;
ahblm_hexcl = core_aph_excl_d; hexcl = core_aph_excl_d;
ahblm_haddr = core_haddr_d; haddr = core_haddr_d;
ahblm_hsize = core_hsize_d; hsize = core_hsize_d;
ahblm_hwrite = core_hwrite_d; hwrite = core_hwrite_d;
ahblm_hprot = hprot_data; hprot = hprot_data;
ahblm_hmaster = 8'h00; hmaster = 8'h00;
end else if (bus_gnt_i) begin end else if (bus_gnt_i) begin
ahblm_htrans = HTRANS_NSEQ; htrans = HTRANS_NSEQ;
ahblm_hexcl = 1'b0; hexcl = 1'b0;
ahblm_haddr = core_haddr_i; haddr = core_haddr_i;
ahblm_hsize = core_hsize_i; hsize = core_hsize_i;
ahblm_hwrite = 1'b0; hwrite = 1'b0;
ahblm_hprot = hprot_instr; hprot = hprot_instr;
ahblm_hmaster = 8'h00; hmaster = 8'h00;
end else begin end else begin
ahblm_htrans = HTRANS_IDLE; htrans = HTRANS_IDLE;
ahblm_hexcl = 1'b0; hexcl = 1'b0;
ahblm_haddr = {W_ADDR{1'b0}}; haddr = {W_ADDR{1'b0}};
ahblm_hsize = 3'h0; hsize = 3'h0;
ahblm_hwrite = 1'b0; hwrite = 1'b0;
ahblm_hprot = 4'h0; hprot = 4'h0;
ahblm_hmaster = 8'h00; hmaster = 8'h00;
end end
end end
assign ahblm_hwdata = bus_active_dph_s ? dbg_sbus_wdata : core_wdata_d; assign hwdata = bus_active_dph_s ? dbg_sbus_wdata : core_wdata_d;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Response routing // Response routing
// Data buses directly connected // Data buses directly connected
assign core_rdata_d = ahblm_hrdata; assign core_rdata_d = hrdata;
assign core_rdata_i = ahblm_hrdata; assign core_rdata_i = hrdata;
assign dbg_sbus_rdata = ahblm_hrdata; assign dbg_sbus_rdata = hrdata;
// Handhshake based on grant and bus stall // Handhshake based on grant and bus stall
assign core_aph_ready_i = ahblm_hready && bus_gnt_i; assign core_aph_ready_i = hready && bus_gnt_i;
assign core_dph_ready_i = bus_active_dph_i && ahblm_hready; assign core_dph_ready_i = bus_active_dph_i && hready;
assign core_dph_err_i = bus_active_dph_i && ahblm_hresp; assign core_dph_err_i = bus_active_dph_i && hresp;
// D-side errors are reported even when not ready, so that the core can make // D-side errors are reported even when not ready, so that the core can make
// use of the two-phase error response to cleanly squash a second load/store // use of the two-phase error response to cleanly squash a second load/store
// chasing the faulting one down the pipeline. // chasing the faulting one down the pipeline.
assign core_aph_ready_d = ahblm_hready && bus_gnt_d; assign core_aph_ready_d = hready && bus_gnt_d;
assign core_dph_ready_d = bus_active_dph_d && ahblm_hready; assign core_dph_ready_d = bus_active_dph_d && hready;
assign core_dph_err_d = bus_active_dph_d && ahblm_hresp; assign core_dph_err_d = bus_active_dph_d && hresp;
assign core_dph_exokay_d = bus_active_dph_d && ahblm_hexokay; assign core_dph_exokay_d = bus_active_dph_d && hexokay;
assign dbg_sbus_err = bus_active_dph_s && ahblm_hresp; assign dbg_sbus_err = bus_active_dph_s && hresp;
assign dbg_sbus_rdy = bus_active_dph_s && ahblm_hready; assign dbg_sbus_rdy = bus_active_dph_s && hready;
endmodule endmodule

View File

@ -5,7 +5,7 @@
// Dual-ported top level file for Hazard3 CPU. This file instantiates the // Dual-ported top level file for Hazard3 CPU. This file instantiates the
// Hazard3 core, and interfaces its instruction fetch and load/store signals // Hazard3 core, and interfaces its instruction fetch and load/store signals
// to a pair of AHB-Lite master ports. // to a pair of AHB5 master ports.
`default_nettype none `default_nettype none

View File

@ -217,19 +217,19 @@ hazard3_cpu_1port #(
.clk (clk), .clk (clk),
.rst_n (rst_n_cpu0), .rst_n (rst_n_cpu0),
.ahblm_haddr (i_haddr), .haddr (i_haddr),
.ahblm_hexcl (i_hexcl), .hexcl (i_hexcl),
.ahblm_hwrite (i_hwrite), .hwrite (i_hwrite),
.ahblm_htrans (i_htrans), .htrans (i_htrans),
.ahblm_hsize (i_hsize), .hsize (i_hsize),
.ahblm_hburst (i_hburst), .hburst (i_hburst),
.ahblm_hprot (i_hprot), .hprot (i_hprot),
.ahblm_hmastlock (i_hmastlock), .hmastlock (i_hmastlock),
.ahblm_hready (i_hready), .hready (i_hready),
.ahblm_hresp (i_hresp), .hresp (i_hresp),
.ahblm_hexokay (i_hexokay), .hexokay (i_hexokay),
.ahblm_hwdata (i_hwdata), .hwdata (i_hwdata),
.ahblm_hrdata (i_hrdata), .hrdata (i_hrdata),
.dbg_req_halt (hart_req_halt [0]), .dbg_req_halt (hart_req_halt [0]),
.dbg_req_halt_on_reset (hart_req_halt_on_reset [0]), .dbg_req_halt_on_reset (hart_req_halt_on_reset [0]),
@ -270,19 +270,19 @@ hazard3_cpu_1port #(
.clk (clk), .clk (clk),
.rst_n (rst_n_cpu1), .rst_n (rst_n_cpu1),
.ahblm_haddr (d_haddr), .haddr (d_haddr),
.ahblm_hexcl (d_hexcl), .hexcl (d_hexcl),
.ahblm_hwrite (d_hwrite), .hwrite (d_hwrite),
.ahblm_htrans (d_htrans), .htrans (d_htrans),
.ahblm_hsize (d_hsize), .hsize (d_hsize),
.ahblm_hburst (d_hburst), .hburst (d_hburst),
.ahblm_hprot (d_hprot), .hprot (d_hprot),
.ahblm_hmastlock (d_hmastlock), .hmastlock (d_hmastlock),
.ahblm_hready (d_hready), .hready (d_hready),
.ahblm_hresp (d_hresp), .hresp (d_hresp),
.ahblm_hexokay (d_hexokay), .hexokay (d_hexokay),
.ahblm_hwdata (d_hwdata), .hwdata (d_hwdata),
.ahblm_hrdata (d_hrdata), .hrdata (d_hrdata),
.dbg_req_halt (hart_req_halt [1]), .dbg_req_halt (hart_req_halt [1]),
.dbg_req_halt_on_reset (hart_req_halt_on_reset [1]), .dbg_req_halt_on_reset (hart_req_halt_on_reset [1]),