Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compressed Extension for SERV #79

Closed
wants to merge 43 commits into from

Conversation

Abdulwadoodd
Copy link
Contributor

@Abdulwadoodd Abdulwadoodd commented Apr 8, 2022

This project is the part of spring '22 LFX Mentorship program. RISC-V Compressed extension support is added to SERV core. All the required compliance tests are passing.
ToDo: OPTIMIZATIONS!!!

Copy link
Owner

@olofk olofk left a comment

Choose a reason for hiding this comment

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

Very good! On the technical side it looks fine. As you mention, there are some optimizations that can be done but I think it's better to pull this in and make those optimizations later.

Most comments are more stylistic things like making sure to not change indentation of signals. I know the current indentation is a bit weird unless you use Emacs, but let's try to keep it as it is. Maybe the easiest way is that I fix the indentation once all the other things are fixed (parameters, license header, etc)

module serv_aligner
#(parameter ALIGN = 0)
(
input clk,rst,
Copy link
Owner

Choose a reason for hiding this comment

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

Put rst on a separate line. Use "input wire" on both signals. Most tools are ok without specifying wire, but Vivado complains when `default_nettype none is set

@@ -0,0 +1,93 @@
module serv_aligner
#(parameter ALIGN = 0)
Copy link
Owner

Choose a reason for hiding this comment

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

Use parameter [0:0] for one-bit parameters. Some SystemVerilog compilers complains otherwise

input wire [31:0] i_wb_ibus_rdt,
input wire i_wb_ibus_ack
);
parameter fetch_align = 2'b00;
Copy link
Owner

Choose a reason for hiding this comment

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

Define these as localparam instead of parameter. We only want to use parameter for values that we intend to change from the outside

rtl/serv_compdec.v Show resolved Hide resolved
@@ -0,0 +1,238 @@
module serv_compdec
#(parameter COMPRESSED=0)
Copy link
Owner

Choose a reason for hiding this comment

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

parameter [0:0]

/* COMPRESSED=1: Enable the compressed decoder and allowed misaligned jump of pc
COMPRESSED=0: Disable the compressed decoder and does not allow the misaligned jump of pc
*/
parameter COMPRESSED = 0,
Copy link
Owner

Choose a reason for hiding this comment

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

[0:0]

ALIGN = 1: Fetch the aligned instruction by making two bus transactions if the misaligned address
is given to the instruction bus.
*/
parameter ALIGN = 0,
Copy link
Owner

Choose a reason for hiding this comment

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

[0:0]

@@ -91,6 +100,7 @@ module serv_rf_top
wire [RF_L2D-1:0] raddr;
wire [RF_WIDTH-1:0] rdata;


Copy link
Owner

Choose a reason for hiding this comment

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

Remove extra line here

rtl/serv_top.v Outdated
(
input wire clk,
input wire i_rst,
input wire i_timer_irq,
`ifdef RISCV_FORMAL
output reg rvfi_valid = 1'b0,
Copy link
Owner

Choose a reason for hiding this comment

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

Avoid reindendation of ports here. The current indentation is done by the Verilog mode in Emacs. I'm aware it has some strange rules about indentation but I don't want to change that as a part of this PR

Copy link
Contributor Author

@Abdulwadoodd Abdulwadoodd Apr 11, 2022

Choose a reason for hiding this comment

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

I didn't notice that my reindentation using VScode made a mess to the indentation on GitHub. Apologies!

@Abdulwadoodd Abdulwadoodd requested a review from olofk April 11, 2022 23:45
endcase
end
reg comp1;
always @(negedge i_ack) begin
Copy link
Owner

Choose a reason for hiding this comment

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

We don't want to clock any logic on negative edges. It can be very problematic for timing

@Abdulwadoodd Abdulwadoodd requested a review from olofk April 12, 2022 22:33
@olofk
Copy link
Owner

olofk commented Jun 13, 2022

Alright! I think we have merged everything now and we can close this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants