Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions data/top_config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[[blocks]]
name = "gpio"
instances = 5 # RPi, Ard, Pmod0, Pmod1, PmodC
instances = 6 # RPi, Ard, Pmod0, Pmod1, PmodC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this being changed? I thought only five of the six GPIOs went through the pinmux

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this file should not only list IPs that relates to pinmux, but list all IP instances.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then why does CI fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's because the manual changes that I have done in the RTL are wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With @alees24 help, the test now pass. I should also test if the bitstream is correct

ios = [
{
name = "ios",
Expand All @@ -9,8 +9,9 @@ ios = [
length = 32
},
]
memory_start = 0x80000040
memory_start = 0x80000000
memory_size = 0x00000040
xbar = { pipeline = "true"}

[[blocks]]
name = "pwm"
Expand Down
76 changes: 73 additions & 3 deletions data/xbar_main.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
size_byte: "0x00000800",
}],
},
{ name: "gpio", // General purpose input and output
{ name: "gpio0",
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
Expand All @@ -70,7 +70,72 @@
xbar: false,
addr_range: [{
base_addr: "0x80000000",
size_byte: "0x00001000",
size_byte: "0x40",
}],
pipeline: true,
},
{ name: "gpio1",
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
req_fifo_pass: false,
rsp_fifo_pass: false,
xbar: false,
addr_range: [{
base_addr: "0x80000040",
size_byte: "0x40",
}],
pipeline: true,
},
{ name: "gpio2",
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
req_fifo_pass: false,
rsp_fifo_pass: false,
xbar: false,
addr_range: [{
base_addr: "0x80000080",
size_byte: "0x40",
}],
pipeline: true,
},
{ name: "gpio3",
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
req_fifo_pass: false,
rsp_fifo_pass: false,
xbar: false,
addr_range: [{
base_addr: "0x800000c0",
size_byte: "0x40",
}],
pipeline: true,
},
{ name: "gpio4",
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
req_fifo_pass: false,
rsp_fifo_pass: false,
xbar: false,
addr_range: [{
base_addr: "0x80000100",
size_byte: "0x40",
}],
pipeline: true,
},
{ name: "gpio5",
type: "device",
clock: "clk_sys_i",
reset: "rst_sys_ni",
req_fifo_pass: false,
rsp_fifo_pass: false,
xbar: false,
addr_range: [{
base_addr: "0x80000140",
size_byte: "0x40",
}],
pipeline: true,
},
Expand Down Expand Up @@ -313,7 +378,6 @@
"hyperram",
"rev_tag",
"dbg_dev",
"gpio",
"pinmux",
"system_info",
"rgbled_ctrl",
Expand All @@ -322,6 +386,12 @@
"timer",
"spi_lcd",
"spi_ethmac",
"gpio0",
"gpio1",
"gpio2",
"gpio3",
"gpio4",
"gpio5",
Comment on lines +389 to +394
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to move these back up to where the single gpio was before? These are roughly in order of address.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to make it to follow the same rules as uart, spi and i2c where every instance is listed individually.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, move these many instances up to where the single instance used to be in the list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, that's not possible without hacking. That's because this file is autogenerated and the order is based on address offset.

"pwm0",
"uart0",
"uart1",
Expand Down
19 changes: 12 additions & 7 deletions data/xbar_main.hjson.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,27 @@
size_byte: "0x00000800",
}],
},
{ name: "gpio", // General purpose input and output
% for block in config.blocks:
% if block.name == "gpio":
% for i in range(block.instances):
{ name: "${f"{block.name}{i}"}",
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",
base_addr: "${hex(block.memory_start + i * block.memory_size)}",
size_byte: "${hex(block.memory_size)}",
}],
pipeline: true,
% for (setting, value) in block.xbar.items():
${setting}: ${value},
% endfor
},
% endfor
% endif
% endfor
{ name: "pinmux", // Pin multiplexer
type: "device",
clock: "clk_sys_i",
Expand Down Expand Up @@ -224,7 +232,6 @@
"hyperram",
"rev_tag",
"dbg_dev",
"gpio",
"pinmux",
"system_info",
"rgbled_ctrl",
Expand All @@ -234,11 +241,9 @@
"spi_lcd",
"spi_ethmac",
% for block in config.blocks:
% if not block.name == "gpio":
% for i in range(block.instances):
"${f"{block.name}{i}"}",
% endfor
% endif
% endfor
"usbdev",
"rv_plic",
Expand Down
18 changes: 14 additions & 4 deletions rtl/bus/sonata_xbar_main.sv

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

63 changes: 39 additions & 24 deletions rtl/bus/tl_main_pkg.sv

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

Loading
Loading