Skip to content

Commit

Permalink
Spit xbar into two levels
Browse files Browse the repository at this point in the history
Attempt to reduce the depth of xbar logic on critical timing paths
to/from the HyperRAM/SRAM by moving most peripherals
from the main cross-bar to a new "peri" (peripheral) sub-crossbar.
Keeps addresses the same, but some few devices have increased
access latency due to being moved to xbar_peri or to improve QoR.

Blocks with increased access latency: timer, system_info, & hw_rev.

Blocks with decreased access latency: plic.
  • Loading branch information
elliotb-lowrisc committed Nov 4, 2024
1 parent d962657 commit 99c2962
Show file tree
Hide file tree
Showing 17 changed files with 788 additions and 523 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
data/xbar_main_generated.hjson linguist-generated=true
data/xbar_peri_generated.hjson linguist-generated=true
doc/ip/pinmux/README.md linguist-generated=true
rtl/bus/sonata_xbar_main.sv linguist-generated=true
rtl/bus/tl_main_pkg.sv linguist-generated=true
rtl/bus/tl_peri_pkg.sv linguist-generated=true
rtl/bus/tl_ifetch_pkg.sv linguist-generated=true
rtl/bus/xbar_main.sv linguist-generated=true
rtl/bus/xbar_peri.sv linguist-generated=true
rtl/bus/xbar_ifetch.sv linguist-generated=true
rtl/system/pinmux.sv linguist-generated=true
rtl/system/sonata_pkg.sv linguist-generated=true
Expand Down
7 changes: 5 additions & 2 deletions data/top_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ ios = [
]
memory_start = 0x80000040
memory_size = 0x00000040
which_xbar = "peri"

[[blocks]]
name = "pwm"
instances = 1
ios = [{ name = "out", type = "output", length = 7 }]
memory_start = 0x80001000
memory_size = 0x00001000
xbar = { pipeline = "true", req_fifo_pass = "false", rsp_fifo_pass = "false" }
which_xbar = "peri"

[[blocks]]
name = "uart"
Expand All @@ -29,7 +30,7 @@ ios = [
]
memory_start = 0x80100000
memory_size = 0x00001000
xbar = { pipeline = "true", req_fifo_pass = "false", rsp_fifo_pass = "false" }
which_xbar = "peri"

[[blocks]]
name = "i2c"
Expand All @@ -41,6 +42,7 @@ ios = [
memory_start = 0x80200000
memory_size = 0x00001000
xbar = { pipeline = "true", req_fifo_pass = "false", rsp_fifo_pass = "false" }
which_xbar = "main"

[[blocks]]
name = "spi"
Expand All @@ -53,6 +55,7 @@ ios = [
]
memory_start = 0x80303000
memory_size = 0x00001000
which_xbar = "main"

# UARTS
[[pins]]
Expand Down
92 changes: 9 additions & 83 deletions data/xbar_main.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -61,87 +61,18 @@
size_byte: "0x00004000",
}],
},
{ name: "gpio", // General purpose input and output
{ name: "peri",
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
req_fifo_pass: false,
rsp_fifo_pass: false,
xbar: false,
addr_range: [{
base_addr: "0x80000000",
size_byte: "0x00001000",
}],
pipeline: true,
},
{ name: "pinmux", // Pin multiplexer
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
req_fifo_pass: false,
rsp_fifo_pass: false,
xbar: false,
addr_range: [{
base_addr: "0x80005000",
size_byte: "0x00001000",
}],
pipeline: true,
},
{ name: "rgbled_ctrl", // RGB LED Controller
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
req_fifo_pass: false,
rsp_fifo_pass: false,
xbar: false,
addr_range: [{
base_addr: "0x80009000",
size_byte: "0x00001000",
size_byte: "0x00200000",
}],
pipeline: true,
},
{ name: "hw_rev", // Hardware revoker control register
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
xbar: false,
addr_range: [{
base_addr: "0x8000A000",
size_byte: "0x00001000",
}],
},
{ name: "xadc", // XADC
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
req_fifo_pass: false,
rsp_fifo_pass: false,
xbar: false,
addr_range: [{
base_addr: "0x8000B000",
size_byte: "0x00001000",
}],
pipeline: true,
},
{ name: "system_info", // System information
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
xbar: false,
addr_range: [{
base_addr: "0x8000C000",
size_byte: "0x00001000",
}],
},
{ name: "timer", // Interrupt timer
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
xbar: false,
addr_range: [{
base_addr: "0x80040000",
size_byte: "0x00010000",
}],
},
{ name: "spi_board",
type: "device",
Expand Down Expand Up @@ -173,8 +104,12 @@
size_byte: "0x00001000",
}],
},
// I^2C devices included here instead of in peri only because
// address range sizes must be a power of two.
// We can easily tolerate an extra cycle of access latency to them,
// so add pipelining to allow them to be placed further away physically.
% for block in config.blocks:
% if not block.name == "gpio":
% if block.which_xbar == "main":
% for i in range(block.instances):
{ name: "${f"{block.name}{i}"}",
type: "device",
Expand Down Expand Up @@ -206,34 +141,25 @@
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
req_fifo_pass: false,
rsp_fifo_pass: false,
xbar: false,
addr_range: [{
// This block is overaligned to 0x0800_0000 bytes since OpenTitan RV_PLIC block expects it.
base_addr: "0x88000000",
size_byte: "0x04000000",
}],
pipeline: true,
},
],
connections: {
ibex_lsu: [
"sram",
"hyperram",
"rev_tag",
"gpio",
"pinmux",
"system_info",
"rgbled_ctrl",
"hw_rev",
"xadc",
"timer",
"peri",
"spi_board",
"spi_lcd",
"spi_ethmac",
% for block in config.blocks:
% if not block.name == "gpio":
% if block.which_xbar == "main":
% for i in range(block.instances):
"${f"{block.name}{i}"}",
% endfor
Expand Down
144 changes: 7 additions & 137 deletions data/xbar_main_generated.hjson

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 99c2962

Please sign in to comment.