Plic inc support#133
Conversation
c57cdd1 to
ed9db92
Compare
marnovandermaas
left a comment
There was a problem hiding this comment.
Thank you so much for your contribution. Just a few comments based on a quick review. How have you tested this? What are the area costs of adding the PLIC to the system?
| parameter logic [31:0] SIM_CTRL_MASK = ~(SIM_CTRL_SIZE-1); | ||
|
|
||
| localparam logic [31:0] PLIC_SIZE = 4 * 1024; // 4 KiB | ||
| localparam logic [31:0] PLIC_START = 32'h80005000; |
There was a problem hiding this comment.
It's probably best to keep the 8000X000 addresses for those that are only 1 KiB in size. Maybe create it at 0x8010000?
There was a problem hiding this comment.
I corrected this in latest commit.
| .irq_external_i(1'b0), | ||
| .irq_fast_i ({14'b0, uart_irq}), | ||
| .irq_external_i(irq_external), | ||
| .irq_fast_i (1'b0), |
There was a problem hiding this comment.
This should still be 15 bits right?
There was a problem hiding this comment.
Corrected in the latest commit.
| assign ndmreset_req = 1'b0; | ||
| end | ||
|
|
||
| assign irq_sources = { |
There was a problem hiding this comment.
Is irq_sources defined somewhere? If so what is its width?
There was a problem hiding this comment.
I declared irq_sources now.
|
|
||
| assign rdata_o = reg_rdata; | ||
|
|
||
| endmodule No newline at end of file |
| parameter logic [31:0] SIM_CTRL_START = 32'h20000; | ||
| parameter logic [31:0] SIM_CTRL_MASK = ~(SIM_CTRL_SIZE-1); | ||
|
|
||
| localparam logic [31:0] PLIC_SIZE = 4 * 1024; // 4 KiB |
There was a problem hiding this comment.
Is this enough? I thought this needed to be 64 MiB?
I am still not able to get UART interrupt working with PLIC. I think my sw driver needs some change.
LUTs increased from 6686 to 6790, FFs increased from 6279 to 6411. |
|
I'm converting this PR to draft until you have a successful UART interrupt firing. |
Add support for PLIC interrupt controller as per RISC-V PLIC specs.