Skip to content

Commit

Permalink
cpu/rocket: variants with double (128b) and quad (256b) wide mem_axi
Browse files Browse the repository at this point in the history
Various development boards' LiteDRAM ports may have native data
widths of either 64 (nexys4ddr), 128 (versa5g), or 256 (trellis)
bits. Add Rocket variants configured with mem_axi ports of matching
data widths, so that a point to point connection between the CPU's
memory port and LiteDRAM can be accomplished without any additional
data width conversion gateware.

Signed-off-by: Gabriel Somlo <[email protected]>
  • Loading branch information
gsomlo committed Dec 21, 2019
1 parent 40c3555 commit cd8feca
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions litex/soc/cores/cpu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class CPUNone(CPU):
"standard": [None, "std"],
"full": [],
"linux" : [],
"linuxd" : [],
"linuxq" : [],
}
CPU_VARIANTS_EXTENSIONS = ["debug", "no-dsp"]

Expand Down
6 changes: 6 additions & 0 deletions litex/soc/cores/cpu/rocket/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,25 @@
CPU_VARIANTS = {
"standard": "freechips.rocketchip.system.LitexConfig",
"linux": "freechips.rocketchip.system.LitexLinuxConfig",
"linuxd": "freechips.rocketchip.system.LitexLinuxDConfig",
"linuxq": "freechips.rocketchip.system.LitexLinuxQConfig",
"full": "freechips.rocketchip.system.LitexFullConfig",
}

GCC_FLAGS = {
"standard": "-march=rv64imac -mabi=lp64 ",
"linux": "-march=rv64imac -mabi=lp64 ",
"linuxd": "-march=rv64imac -mabi=lp64 ",
"linuxq": "-march=rv64imac -mabi=lp64 ",
"full": "-march=rv64imafdc -mabi=lp64 ",
}

AXI_DATA_WIDTHS = {
# variant : (mem, mmio)
"standard": ( 64, 64),
"linux": ( 64, 64),
"linuxd": (128, 64),
"linuxq": (256, 64),
"full": ( 64, 64),
}

Expand Down
2 changes: 1 addition & 1 deletion litex/soc/cores/cpu/rocket/verilog
2 changes: 2 additions & 0 deletions litex/soc/integration/soc_sdram.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ def register_sdram(self, phy, geom_settings, timing_settings, main_ram_size_limi
if self.cpu.name == "rocket":
# Rocket has its own I/D L1 cache: connect directly to LiteDRAM, also bypassing MMIO/CSR wb bus:
if port.data_width == self.cpu.mem_axi.data_width:
print("# Matching AXI MEM data width ({})\n".format(port.data_width))
# straightforward AXI link, no data_width conversion needed:
self.submodules += LiteDRAMAXI2Native(self.cpu.mem_axi, port,
base_address=self.mem_map["main_ram"])
else:
print("# Converting MEM data width: ram({}) to cpu({}), via Wishbone\n".format(port.data_width, self.cpu.mem_axi.data_width))
# FIXME: replace WB data-width converter with native AXI converter!!!
mem_wb = wishbone.Interface(data_width=self.cpu.mem_axi.data_width,
adr_width=32-log2_int(self.cpu.mem_axi.data_width//8))
Expand Down

0 comments on commit cd8feca

Please sign in to comment.