Skip to content

Commit

Permalink
Merge pull request #100 from pulp-platform/fc/v5.0.0-beautify-cherrypick
Browse files Browse the repository at this point in the history
Beautification & Homogeneization
  • Loading branch information
micprog authored May 23, 2024
2 parents e81422a + c95f962 commit 470e10f
Show file tree
Hide file tree
Showing 24 changed files with 3,884 additions and 3,903 deletions.
4 changes: 2 additions & 2 deletions rtl/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = off

# 4 space indentation
# 2 space indentation
[*.{sv, svh, v}]
indent_style = space
indent_size = 4
indent_size = 2

32 changes: 16 additions & 16 deletions rtl/components/obi_pulp_adapter.sv
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ module obi_pulp_adapter (
// Block multiple requests, as the memory does not support them
// core_req_i is kept stable by cv32e40p (OBI compliant)
always_comb begin
case (ps)
WAIT_GNT: begin
// Idle state, the memory has not received any request yet
mem_req_o = core_req_i;
ns = (core_req_i && mem_gnt_i) ? WAIT_VALID : WAIT_GNT;
end
WAIT_VALID: begin
// The memory has received and granted a request. Filter the next request until the memory is ready to accept it.
mem_req_o = (core_req_i && mem_rvalid_i) ? 1'b1 : 1'b0;
ns = (mem_rvalid_i && !mem_gnt_i) ? WAIT_GNT : WAIT_VALID;
end
default: begin
mem_req_o = core_req_i;
ns = WAIT_GNT;
end
endcase
case (ps)
WAIT_GNT: begin
// Idle state, the memory has not received any request yet
mem_req_o = core_req_i;
ns = (core_req_i && mem_gnt_i) ? WAIT_VALID : WAIT_GNT;
end
WAIT_VALID: begin
// The memory has received and granted a request. Filter the next request until the memory is ready to accept it.
mem_req_o = (core_req_i && mem_rvalid_i) ? 1'b1 : 1'b0;
ns = (mem_rvalid_i && !mem_gnt_i) ? WAIT_GNT : WAIT_VALID;
end
default: begin
mem_req_o = core_req_i;
ns = WAIT_GNT;
end
endcase
end

endmodule
107 changes: 50 additions & 57 deletions rtl/components/tb_fs_handler.sv
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ module tb_fs_handler #(
event READ_EVENT;
event WRITE_EVENT;



assign req_stdout = ( (CSN == 1'b0) && (WEN == 1'b0) && ({ADDR[31:12],12'h00} == `ADDR_STDOUT_PRINT) );
assign req_fopen = ((CSN == 1'b0) && (WEN == 1'b0) && (ADDR == `ADDR_STDOUT_FS));

Expand Down Expand Up @@ -147,7 +145,6 @@ module tb_fs_handler #(
.dat_i (WDATA[31:0])
);


always @(FOPEN_EVENT) begin
FOPEN();
end
Expand All @@ -156,7 +153,6 @@ module tb_fs_handler #(
FCLOSE();
end


always @(READ_EVENT) begin
F_READ();
end
Expand All @@ -165,7 +161,6 @@ module tb_fs_handler #(
F_WRITE();
end


always_ff @(posedge clk, negedge rst_n) begin
if (rst_n == 1'b0) begin
RDATA <= '0;
Expand All @@ -178,14 +173,12 @@ module tb_fs_handler #(
if ((ADDR == `ADDR_FOPEN) && (CSN == 1'b0) && (WEN == 1'b0) && (WDATA == `CMD_FCLOSE))
->FCLOSE_EVENT;


if ((ADDR == `ADDR_RW) && (CSN == 1'b0) && (WEN == 1'b1))->READ_EVENT;

if ((ADDR == `ADDR_RW) && (CSN == 1'b0) && (WEN == 1'b0))->WRITE_EVENT;
end
end


task FOPEN;
FILE_00 = $fopen("fs/file_00.txt", "r");
tmp = $fgets(file_name, FILE_00);
Expand Down Expand Up @@ -266,59 +259,59 @@ module tb_fs_handler_debug #(
else core_index = 0;

if (OPEN_FILES)
$fwrite(IOFILE[core_index], "%s", dat_i[7:0]);
$fwrite(IOFILE[core_index], "%s", dat_i[7:0]);

if (SILENT_MODE == "OFF") begin
if (COLORED_MODE == "ON") begin
case (core_index)
0: begin
$write("%c[1;30m", 27);
end
1: begin
$write("%c[1;31m", 27);
end
2: begin
$write("%c[1;32m", 27);
end
3: begin
$write("%c[1;33m", 27);
end
4: begin
$write("%c[1;34m", 27);
end
5: begin
$write("%c[1;35m", 27);
end
6: begin
$write("%c[1;36m", 27);
end
7: begin
$write("%c[4;30m", 27);
end
8: begin
$write("%c[4;31m", 27);
end
9: begin
$write("%c[4;32m", 27);
end
10: begin
$write("%c[4;33m", 27);
end
11: begin
$write("%c[4;34m", 27);
end
12: begin
$write("%c[4;35m", 27);
end
13: begin
$write("%c[4;36m", 27);
end
14: begin
$write("%c[5;30m", 27);
end
15: begin
$write("%c[5;31m", 27);
end
0: begin
$write("%c[1;30m", 27);
end
1: begin
$write("%c[1;31m", 27);
end
2: begin
$write("%c[1;32m", 27);
end
3: begin
$write("%c[1;33m", 27);
end
4: begin
$write("%c[1;34m", 27);
end
5: begin
$write("%c[1;35m", 27);
end
6: begin
$write("%c[1;36m", 27);
end
7: begin
$write("%c[4;30m", 27);
end
8: begin
$write("%c[4;31m", 27);
end
9: begin
$write("%c[4;32m", 27);
end
10: begin
$write("%c[4;33m", 27);
end
11: begin
$write("%c[4;34m", 27);
end
12: begin
$write("%c[4;35m", 27);
end
13: begin
$write("%c[4;36m", 27);
end
14: begin
$write("%c[5;30m", 27);
end
15: begin
$write("%c[5;31m", 27);
end
endcase
end

Expand All @@ -339,7 +332,7 @@ module tb_fs_handler_debug #(
if (SILENT_MODE == "OFF") begin
if (FULL_LINE == "ON") begin
$display("[STDOUT-CL%0d_PE%0d, %t] %s", CLUSTER_ID, core_index, $realtime,
LINE_BUFFER[core_index].substr(0, LINE_BUFFER[core_index].len() - 2));
LINE_BUFFER[core_index].substr(0, LINE_BUFFER[core_index].len() - 2));
LINE_BUFFER[core_index] = "";
end else begin
$display("CL%0d_PE%0d Writing line", CLUSTER_ID, core_index);
Expand Down
Loading

0 comments on commit 470e10f

Please sign in to comment.