mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Third attempt at fixing the write enables for the icache cacheway.
This commit is contained in:
parent
230c794edd
commit
b04e00d196
2
wally-pipelined/src/cache/icache.sv
vendored
2
wally-pipelined/src/cache/icache.sv
vendored
@ -142,7 +142,7 @@ module icache
|
|||||||
.RAdr(RAdr),
|
.RAdr(RAdr),
|
||||||
.PAdr(PCTagF),
|
.PAdr(PCTagF),
|
||||||
.WriteEnable(SRAMWayWriteEnable),
|
.WriteEnable(SRAMWayWriteEnable),
|
||||||
.WriteWordEnable({NUMWAYS{1'b1}}),
|
.WriteWordEnable({{(BLOCKLEN/`XLEN){1'b1}}}),
|
||||||
.TagWriteEnable(SRAMWayWriteEnable),
|
.TagWriteEnable(SRAMWayWriteEnable),
|
||||||
.WriteData(ICacheMemWriteData),
|
.WriteData(ICacheMemWriteData),
|
||||||
.SetValid(ICacheMemWriteEnable),
|
.SetValid(ICacheMemWriteEnable),
|
||||||
|
@ -43,6 +43,7 @@ module uncore (
|
|||||||
input logic HREADYEXT, HRESPEXT,
|
input logic HREADYEXT, HRESPEXT,
|
||||||
output logic [`AHBW-1:0] HRDATA,
|
output logic [`AHBW-1:0] HRDATA,
|
||||||
output logic HREADY, HRESP,
|
output logic HREADY, HRESP,
|
||||||
|
output logic HSELEXT,
|
||||||
// delayed signals
|
// delayed signals
|
||||||
input logic [2:0] HADDRD,
|
input logic [2:0] HADDRD,
|
||||||
input logic [3:0] HSIZED,
|
input logic [3:0] HSIZED,
|
||||||
@ -81,12 +82,14 @@ module uncore (
|
|||||||
// unswizzle HSEL signals
|
// unswizzle HSEL signals
|
||||||
assign {HSELBootTim, HSELTim, HSELCLINT, HSELGPIO, HSELUART, HSELPLIC} = HSELRegions[5:0];
|
assign {HSELBootTim, HSELTim, HSELCLINT, HSELGPIO, HSELUART, HSELPLIC} = HSELRegions[5:0];
|
||||||
|
|
||||||
|
assign HSELEXT = HSELRegions[4];
|
||||||
|
|
||||||
// subword accesses: converts HWDATAIN to HWDATA
|
// subword accesses: converts HWDATAIN to HWDATA
|
||||||
subwordwrite sww(.*);
|
subwordwrite sww(.*);
|
||||||
|
|
||||||
generate
|
generate
|
||||||
// tightly integrated memory
|
// tightly integrated memory
|
||||||
dtim #(.BASE(`TIM_BASE), .RANGE(`TIM_RANGE)) dtim (.*);
|
//dtim #(.BASE(`TIM_BASE), .RANGE(`TIM_RANGE)) dtim (.*);
|
||||||
if (`BOOTTIM_SUPPORTED) begin : bootdtim
|
if (`BOOTTIM_SUPPORTED) begin : bootdtim
|
||||||
dtim #(.BASE(`BOOTTIM_BASE), .RANGE(`BOOTTIM_RANGE)) bootdtim(.HSELTim(HSELBootTim), .HREADTim(HREADBootTim), .HRESPTim(HRESPBootTim), .HREADYTim(HREADYBootTim), .*);
|
dtim #(.BASE(`BOOTTIM_BASE), .RANGE(`BOOTTIM_RANGE)) bootdtim(.HSELTim(HSELBootTim), .HREADTim(HREADBootTim), .HRESPTim(HRESPBootTim), .HREADYTim(HREADYBootTim), .*);
|
||||||
end
|
end
|
||||||
@ -119,19 +122,22 @@ module uncore (
|
|||||||
|
|
||||||
// mux could also include external memory
|
// mux could also include external memory
|
||||||
// AHB Read Multiplexer
|
// AHB Read Multiplexer
|
||||||
assign HRDATA = ({`XLEN{HSELTimD}} & HREADTim) |
|
//assign HRDATA = ({`XLEN{HSELTimD}} & HREADTim) |
|
||||||
|
assign HRDATA = ({`XLEN{HSELTimD}} & HRDATAEXT) |
|
||||||
({`XLEN{HSELCLINTD}} & HREADCLINT) |
|
({`XLEN{HSELCLINTD}} & HREADCLINT) |
|
||||||
({`XLEN{HSELPLICD}} & HREADPLIC) |
|
({`XLEN{HSELPLICD}} & HREADPLIC) |
|
||||||
({`XLEN{HSELGPIOD}} & HREADGPIO) |
|
({`XLEN{HSELGPIOD}} & HREADGPIO) |
|
||||||
({`XLEN{HSELBootTimD}} & HREADBootTim) |
|
({`XLEN{HSELBootTimD}} & HREADBootTim) |
|
||||||
({`XLEN{HSELUARTD}} & HREADUART);
|
({`XLEN{HSELUARTD}} & HREADUART);
|
||||||
assign HRESP = HSELTimD & HRESPTim |
|
//assign HRESP = HSELTimD & HRESPTim |
|
||||||
|
assign HRESP = HSELTimD & HRESPEXT |
|
||||||
HSELCLINTD & HRESPCLINT |
|
HSELCLINTD & HRESPCLINT |
|
||||||
HSELPLICD & HRESPPLIC |
|
HSELPLICD & HRESPPLIC |
|
||||||
HSELGPIOD & HRESPGPIO |
|
HSELGPIOD & HRESPGPIO |
|
||||||
HSELBootTimD & HRESPBootTim |
|
HSELBootTimD & HRESPBootTim |
|
||||||
HSELUARTD & HRESPUART;
|
HSELUARTD & HRESPUART;
|
||||||
assign HREADY = HSELTimD & HREADYTim |
|
//assign HREADY = HSELTimD & HREADYTim |
|
||||||
|
assign HREADY = HSELTimD & HREADYEXT |
|
||||||
HSELCLINTD & HREADYCLINT |
|
HSELCLINTD & HREADYCLINT |
|
||||||
HSELPLICD & HREADYPLIC |
|
HSELPLICD & HREADYPLIC |
|
||||||
HSELGPIOD & HREADYGPIO |
|
HSELGPIOD & HREADYGPIO |
|
||||||
|
@ -32,26 +32,28 @@
|
|||||||
`include "wally-config.vh"
|
`include "wally-config.vh"
|
||||||
|
|
||||||
module wallypipelinedsoc (
|
module wallypipelinedsoc (
|
||||||
input logic clk, reset,
|
input logic clk, reset,
|
||||||
// AHB Lite Interface
|
// AHB Lite Interface
|
||||||
// inputs from external memory
|
// inputs from external memory
|
||||||
input logic [`AHBW-1:0] HRDATAEXT,
|
input logic [`AHBW-1:0] HRDATAEXT,
|
||||||
input logic HREADYEXT, HRESPEXT,
|
input logic HREADYEXT, HRESPEXT,
|
||||||
|
output logic HSELEXT,
|
||||||
// outputs to external memory, shared with uncore memory
|
// outputs to external memory, shared with uncore memory
|
||||||
output logic HCLK, HRESETn,
|
output logic HCLK, HRESETn,
|
||||||
output logic [31:0] HADDR,
|
output logic [31:0] HADDR,
|
||||||
output logic [`AHBW-1:0] HWDATA,
|
output logic [`AHBW-1:0] HWDATA,
|
||||||
output logic HWRITE,
|
output logic HWRITE,
|
||||||
output logic [2:0] HSIZE,
|
output logic [2:0] HSIZE,
|
||||||
output logic [2:0] HBURST,
|
output logic [2:0] HBURST,
|
||||||
output logic [3:0] HPROT,
|
output logic [3:0] HPROT,
|
||||||
output logic [1:0] HTRANS,
|
output logic [1:0] HTRANS,
|
||||||
output logic HMASTLOCK,
|
output logic HMASTLOCK,
|
||||||
|
output logic HREADY,
|
||||||
// I/O Interface
|
// I/O Interface
|
||||||
input logic [31:0] GPIOPinsIn,
|
input logic [31:0] GPIOPinsIn,
|
||||||
output logic [31:0] GPIOPinsOut, GPIOPinsEn,
|
output logic [31:0] GPIOPinsOut, GPIOPinsEn,
|
||||||
input logic UARTSin,
|
input logic UARTSin,
|
||||||
output logic UARTSout
|
output logic UARTSout
|
||||||
);
|
);
|
||||||
|
|
||||||
// to instruction memory *** remove later
|
// to instruction memory *** remove later
|
||||||
@ -59,7 +61,7 @@ module wallypipelinedsoc (
|
|||||||
|
|
||||||
// Uncore signals
|
// Uncore signals
|
||||||
logic [`AHBW-1:0] HRDATA; // from AHB mux in uncore
|
logic [`AHBW-1:0] HRDATA; // from AHB mux in uncore
|
||||||
logic HREADY, HRESP;
|
//logic HREADY, HRESP;
|
||||||
logic [5:0] HSELRegions;
|
logic [5:0] HSELRegions;
|
||||||
logic InstrAccessFaultF, DataAccessFaultM;
|
logic InstrAccessFaultF, DataAccessFaultM;
|
||||||
logic TimerIntM, SwIntM; // from CLINT
|
logic TimerIntM, SwIntM; // from CLINT
|
||||||
@ -70,6 +72,8 @@ module wallypipelinedsoc (
|
|||||||
logic HWRITED;
|
logic HWRITED;
|
||||||
logic [15:0] rd2; // bogus, delete when real multicycle fetch works
|
logic [15:0] rd2; // bogus, delete when real multicycle fetch works
|
||||||
logic [31:0] InstrF;
|
logic [31:0] InstrF;
|
||||||
|
logic HRESP;
|
||||||
|
|
||||||
|
|
||||||
// instantiate processor and memories
|
// instantiate processor and memories
|
||||||
wallypipelinedhart hart(.*);
|
wallypipelinedhart hart(.*);
|
||||||
@ -77,4 +81,4 @@ module wallypipelinedsoc (
|
|||||||
// instructions now come from uncore memory. This line can be removed at any time.
|
// instructions now come from uncore memory. This line can be removed at any time.
|
||||||
// imem imem(.AdrF(PCF[`XLEN-1:1]), .*); // temporary until uncore memory is finished***
|
// imem imem(.AdrF(PCF[`XLEN-1:1]), .*); // temporary until uncore memory is finished***
|
||||||
uncore uncore(.HWDATAIN(HWDATA), .*);
|
uncore uncore(.HWDATAIN(HWDATA), .*);
|
||||||
endmodule
|
endmodule
|
||||||
|
101
wally-pipelined/src/wally/wallypipelinedsocwrapper.v
Normal file
101
wally-pipelined/src/wally/wallypipelinedsocwrapper.v
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
///////////////////////////////////////////
|
||||||
|
// wally-pipelinedsoc.sv
|
||||||
|
//
|
||||||
|
// Written: David_Harris@hmc.edu 6 November 2020
|
||||||
|
// Modified:
|
||||||
|
//
|
||||||
|
// Purpose: System on chip including pipelined processor and memories
|
||||||
|
// Full RV32/64IC instruction set
|
||||||
|
//
|
||||||
|
// Note: the CSRs do not support the following features
|
||||||
|
//- Disabling portions of the instruction set with bits of the MISA register
|
||||||
|
//- Changing from RV64 to RV32 by writing the SXL/UXL bits of the STATUS register
|
||||||
|
// As of January 2020, virtual memory is not yet supported
|
||||||
|
//
|
||||||
|
// A component of the Wally configurable RISC-V project.
|
||||||
|
//
|
||||||
|
// Copyright (C) 2021 Harvey Mudd College & Oklahoma State University
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
|
||||||
|
// files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
|
||||||
|
// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
|
||||||
|
// is furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||||
|
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
||||||
|
// OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
///////////////////////////////////////////
|
||||||
|
|
||||||
|
`include "wally-config.vh"
|
||||||
|
|
||||||
|
module wallypipelinedsocwrapper (
|
||||||
|
input clk, reset,
|
||||||
|
// AHB Lite Interface
|
||||||
|
// inputs from external memory
|
||||||
|
input [`AHBW-1:0] HRDATAEXT,
|
||||||
|
input HREADYEXT, HRESPEXT,
|
||||||
|
output HSELEXT,
|
||||||
|
// outputs to external memory, shared with uncore memory
|
||||||
|
output HCLK, HRESETn,
|
||||||
|
output [31:0] HADDR,
|
||||||
|
output [`AHBW-1:0] HWDATA,
|
||||||
|
output HWRITE,
|
||||||
|
output [2:0] HSIZE,
|
||||||
|
output [2:0] HBURST,
|
||||||
|
output [3:0] HPROT,
|
||||||
|
output [1:0] HTRANS,
|
||||||
|
output HMASTLOCK,
|
||||||
|
output HREADY,
|
||||||
|
// I/O Interface
|
||||||
|
input [31:0] GPIOPinsIn,
|
||||||
|
output [31:0] GPIOPinsOut, GPIOPinsEn,
|
||||||
|
input UARTSin,
|
||||||
|
output UARTSout
|
||||||
|
);
|
||||||
|
|
||||||
|
// to instruction memory *** remove later
|
||||||
|
wire [`XLEN-1:0] PCF;
|
||||||
|
|
||||||
|
// Uncore signals
|
||||||
|
wire [`AHBW-1:0] HRDATA; // from AHB mux in uncore
|
||||||
|
wire HREADY, HRESP;
|
||||||
|
wire [5:0] HSELRegions;
|
||||||
|
wire InstrAccessFaultF, DataAccessFaultM;
|
||||||
|
wire TimerIntM, SwIntM; // from CLINT
|
||||||
|
wire [63:0] MTIME_CLINT, MTIMECMP_CLINT; // from CLINT to CSRs
|
||||||
|
wire ExtIntM; // from PLIC
|
||||||
|
wire [2:0] HADDRD;
|
||||||
|
wire [3:0] HSIZED;
|
||||||
|
wire HWRITED;
|
||||||
|
wire [15:0] rd2; // bogus, delete when real multicycle fetch works
|
||||||
|
wire [31:0] InstrF;
|
||||||
|
|
||||||
|
// wrapper for fpga
|
||||||
|
wallypipelinedsoc wallypipelinedsoc
|
||||||
|
(.clk(clk),
|
||||||
|
.reset(reset),
|
||||||
|
.HRDATAEXT(HRDATAEXT),
|
||||||
|
.HREADYEXT(HREADYEXT),
|
||||||
|
.HRESPEXT(HRESPEXT),
|
||||||
|
.HSELEXT(HSELEXT),
|
||||||
|
.HCLK(HCLK),
|
||||||
|
.HRESETn(HRESETn),
|
||||||
|
.HADDR(HADDR),
|
||||||
|
.HWDATA(HWDATA),
|
||||||
|
.HWRITE(HWRITE),
|
||||||
|
.HSIZE(HSIZE),
|
||||||
|
.HBURST(HBURST),
|
||||||
|
.HPROT(HPROT),
|
||||||
|
.HTRANS(HTRANS),
|
||||||
|
.HMASTLOCK(HMASTLOCK),
|
||||||
|
.HREADY(HREADY),
|
||||||
|
.GPIOPinsIn(GPIOPinsIn),
|
||||||
|
.GPIOPinsOut(GPIOPinsOut),
|
||||||
|
.GPIOPinsEn(GPIOPinsEn),
|
||||||
|
.UARTSin(UARTSin),
|
||||||
|
.UARTSout(UARTSout));
|
||||||
|
|
||||||
|
endmodule
|
Loading…
Reference in New Issue
Block a user