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

Adding back the HWLoop #436

Merged
merged 127 commits into from
Aug 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
d147824
using always 32bits prefetcher
davideschiavone Dec 10, 2019
38c944c
removed HWLoop, RVC and prefetcher fifo with RVC support, now just a …
davideschiavone Dec 10, 2019
dff4d79
:construction: Adding back RVC support with aligned and compressed de…
davideschiavone Dec 10, 2019
0f91fa2
adding riscv aligner
davideschiavone Dec 10, 2019
729ad63
fix halt if and update waves
davideschiavone Dec 10, 2019
c6f71a6
add support for branches
davideschiavone Dec 10, 2019
beb1135
:construction: keep on working on RVC support in the ID stage
davideschiavone Dec 10, 2019
2c2a2ca
adding pc_if as next pc and change pipe_flush to wfi
davideschiavone Dec 10, 2019
db48689
updated rtl/riscv_aligner.sv
Dec 11, 2019
96f6aa9
removed pc registers in IF
davideschiavone Dec 11, 2019
a9fa357
:construction: reworked HWLoop in new pipeline
davideschiavone Dec 11, 2019
8513f91
removed unused signal from controller
Dec 11, 2019
3bfe1ea
tmp removed unused states in LSU
Dec 11, 2019
89884e5
fixed WAIT RVALID on hwloop branches during stalls on iMem
Dec 11, 2019
1532dd9
added ports hwloop_target_reg from ID to IF
Dec 11, 2019
d89347e
fixed wait for grant when hwloop is used
davideschiavone Dec 11, 2019
7c376e6
update hwloop controller
davideschiavone Dec 12, 2019
80f2716
:construction: using the last version of FIFO from common cells
davideschiavone Dec 12, 2019
674e75e
lowering grant and valid on correct edge of the clock in random stall…
davideschiavone Dec 13, 2019
8ba9f4b
removed deprecated 128bit prefetcher
davideschiavone Dec 13, 2019
e003339
:bug: add flushing conditions in RVALID states during HWLoops
davideschiavone Dec 13, 2019
bcfa13d
updated rtl/riscv_prefetch_buffer.sv: added default for fifo_flush
Dec 13, 2019
6fadc44
:police_car: updated rtl/riscv_prefetch_buffer.sv: fixed valid_o in W…
Dec 13, 2019
40c3d00
Updated rtl/riscv_hwloop_controller.sv: HwloopTarget and pcisEnd is u…
Jan 13, 2020
f18ca3d
updated
Jan 13, 2020
0434224
updated rtl/riscv_prefetch_buffer.sv. Fixed issue on ABORT HWLOOP
Jan 23, 2020
8a4aca0
updated src_files.yml
Jan 23, 2020
59178b9
BUGFIX, fixed aligner and controller handshake
Jan 24, 2020
fd1e5be
:sparkles: merging CLINT on new pipeline branch
davideschiavone Mar 11, 2020
12915fe
:art: updating Bender
davideschiavone Mar 11, 2020
193b661
align tb_top settings to master
Mar 26, 2020
6536507
:bug: fix wrong update of instruction when flushing
Mar 26, 2020
eeb6d10
fix NS in riscv_aligner
mp-17 Mar 30, 2020
0a7d024
merge from master
mp-17 Mar 30, 2020
5ad84f6
:bug: add special case for stalled JUMP in aligner
mp-17 Apr 3, 2020
acb2f09
:bug: fix memory stall activation routine
mp-17 Apr 3, 2020
9373be2
:sparkles: mtvec and mtvex writable when PULP_SECURE=0 #254
davideschiavone Mar 31, 2020
cd4355c
Disable inference of FP registers when `Zfinx` is enabled
andreaskurth Mar 31, 2020
13956dd
Disable inference of FP latches when `Zfinx` is enabled
andreaskurth Apr 1, 2020
6344fe0
:recycle: copied fifo from common cells
davideschiavone Apr 4, 2020
4999ee0
:construction: updated aligner next state and valid logic
davideschiavone Apr 4, 2020
cf81e05
Merge remote-tracking branch 'origin' into new_pipeline
davideschiavone Apr 4, 2020
c9d4ade
:construction: new HWLoop integrated into controller and new Prefetch…
davideschiavone Apr 9, 2020
934c05d
:zap: removed dependency from data_* to instr_*
davideschiavone Apr 9, 2020
8e2c248
:wastebasket: removed riscv_hwloop_controller
davideschiavone Apr 9, 2020
a393eb1
:construction: :art: clean up pf and add conditions in IDLE to be add…
davideschiavone Apr 9, 2020
58d0784
fix in prefetcher when IDLE and fifo not empty
davideschiavone Apr 9, 2020
3da5ff5
fix to hwloop body signals and jump conditions
davideschiavone Apr 9, 2020
7cc399d
:construction: :art: added another condition to handle returns from t…
davideschiavone Apr 9, 2020
aa96ec8
merge master
davideschiavone Apr 10, 2020
498a9c2
merge master
davideschiavone May 11, 2020
2fd49be
add memory stalls to interrupt test
mp-17 Apr 14, 2020
e91424d
:bug: fix -jump lost if waiting for rvalid- bug
mp-17 May 13, 2020
081e963
add hwlp-test
mp-17 May 14, 2020
cf0db8e
fix controller condition to be inside a HWLP
mp-17 May 14, 2020
2b4e610
fixed and reorganized prefetcher
mp-17 May 14, 2020
9d1dd0a
add hwlp-test
mp-17 May 14, 2020
c8a5cbc
hwlp-test updated
mp-17 May 14, 2020
b4060f3
merge master
mp-17 May 27, 2020
0b5e6ef
:fix: fix and clean prefetcher
mp-17 May 27, 2020
edf4060
:fix: fix prefetcher for D-MEM stalls
mp-17 May 27, 2020
b07b714
:bug: fix jump to wrong hwlp for FIFO_DEPTH>2
mp-17 Jun 15, 2020
82ba7d5
:boom: merge master
davideschiavone Jun 15, 2020
af48c30
propagate PULP_HWLP param to tb_top
mp-17 Jun 16, 2020
0585591
:boom: merge master with OBI
davideschiavone Jun 16, 2020
db047e5
merge master
davideschiavone Jun 16, 2020
51c8747
fix missing connection
mp-17 Jun 16, 2020
4fe1659
merge new_pipeline_obi
mp-17 Jun 17, 2020
3f229c5
fix previous merge
mp-17 Jun 17, 2020
d4b38e5
:bug: hold PC_ID during ecall for correct MEPC
mp-17 Jun 18, 2020
c6c29fa
add div/ebreak/fence.i to hwlp_test
mp-17 Jun 18, 2020
768d33a
:bug: hold PC_ID in ebreak/ill.instr for correct MEPC
mp-17 Jun 18, 2020
9c5fa36
:bug: prefetcher now correctly aborts hwlp jumps
mp-17 Jun 18, 2020
47df2f3
:bug: hold PC_ID in fencei for correct jump
mp-17 Jun 18, 2020
075fddd
:bug: fix spurious HWLP_begin I-MEM req when aborting the previous req
mp-17 Jun 23, 2020
ad013ad
:boom: merge master new file prefix names
davideschiavone Jun 23, 2020
ecae92d
:boom: added prefetch busy
davideschiavone Jun 23, 2020
1f4d4c6
refactor mem_stall support
mp-17 Jun 26, 2020
2085fb1
:bug: fix -mret does not jump- bug
mp-17 Jun 26, 2020
d46a3a7
update file lists to cv32e40p new_pipeline
mp-17 Jun 26, 2020
939d147
update riscv tb names to cv32e40p
mp-17 Jun 26, 2020
8b7bc02
remove prefetch_controller from source file lists
mp-17 Jun 26, 2020
2b0557b
fixed debug single step
davideschiavone Jun 29, 2020
e41f88f
:bug: fix access restriction to trigger registers
mp-17 Jun 29, 2020
9c9fb1e
:bug: fix peripheral rdata answers during outst. trans. with mem stalls
mp-17 Jul 2, 2020
bc4106d
adapt prefetcher to new OBI interface (HWLP not supported)
mp-17 Jul 2, 2020
a69237e
update prefetcher controller with hwlp support
mp-17 Jul 2, 2020
d6ad52f
fix hwlp support
mp-17 Jul 3, 2020
e624d16
fix - make hwlp_jump_o last only one cycle
mp-17 Jul 3, 2020
a1d0c21
adapt signal names to hwlp_ instead of hwloop_
mp-17 Jul 3, 2020
b2381da
:bug: support multiple outst. mem reqs in random stall interface
mp-17 Jul 3, 2020
69e2621
add Prefetch Controller to waves
mp-17 Jul 3, 2020
fff37bb
align module instantiation order to master (prefetch_buffer)
mp-17 Jul 3, 2020
c57dade
beautify and add assertions to prefetch_controller
mp-17 Jul 3, 2020
74aef0e
removed display statements
davideschiavone Jul 6, 2020
f78b228
update src_files.yml
mp-17 Jul 6, 2020
f00ad1f
:boom: merge master
davideschiavone Jul 7, 2020
ab3eb19
fix src_file
davideschiavone Jul 7, 2020
a383079
:bug: counter-fix: modify access restrictions for trigger CSR
mp-17 Jul 7, 2020
27fd106
:bug: force interrupt generator to assert at least 1 irq line
mp-17 Jul 8, 2020
d7d8b4d
:bug: interrupts must have higher priority than hwlp in prefetch ctrl
mp-17 Jul 8, 2020
b07bbd0
optimize prefetch_controller requests control during jumps
mp-17 Jul 8, 2020
99dfa79
:boom: merge master
davideschiavone Jul 9, 2020
6dd65c2
:bug: fix corner case hwlp_jump at HWLP_END after mret from interrupt
mp-17 Jul 10, 2020
46d85f5
cut path id_ready->branch and :bug: fix mstatus.mpie overwrite
mp-17 Jul 10, 2020
eecc931
refactor hwlp test and add hwlp+interrupt self-test
mp-17 Jul 10, 2020
fa3c10e
adapt interrupt generator to new interrupt interface
mp-17 Jul 10, 2020
7da64c9
:boom: merge master
davideschiavone Jul 13, 2020
139108f
:boom: merge master
davideschiavone Aug 4, 2020
030a5f8
added hwloop test --> to be moved in core-v-verif
davideschiavone Aug 4, 2020
ba9b4bc
fix manifest file and removed fetch_fifo
davideschiavone Aug 5, 2020
388f59e
fix wfi
davideschiavone Aug 5, 2020
4df8625
fix branch_address in aligner
davideschiavone Aug 6, 2020
9a0152a
clean id-stage, aligner, controller
mp-17 Aug 6, 2020
45e89ac
update src_file
davideschiavone Aug 12, 2020
eac9ac5
:bug: fix next pc during wfi in debug mode
davideschiavone Aug 12, 2020
561cd88
update reviews PR#436
davideschiavone Aug 12, 2020
23d9bb9
removed ALIGNED16 state from aligner
davideschiavone Aug 13, 2020
adea64e
:boom: removed fsm in if_stage
davideschiavone Aug 14, 2020
d22d781
2nd update reviews PR#436
davideschiavone Aug 18, 2020
d5d724e
moving aligner to if
davideschiavone Aug 18, 2020
0b4d9a7
:bug: fix debug
davideschiavone Aug 19, 2020
8eebae5
moved rvc decoder in if
davideschiavone Aug 19, 2020
89d3045
:recycle: clean up the code
davideschiavone Aug 20, 2020
6420cdf
removed extra variable in Makefile
davideschiavone Aug 20, 2020
e460eff
Merge pull request #1 from davideschiavone/new_pipeline_aligner_rvc_if
davideschiavone Aug 20, 2020
badb22f
removed instr_width parameter
davideschiavone Aug 28, 2020
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
3 changes: 2 additions & 1 deletion Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package:

dependencies:
fpnew: { git: "https://github.com/pulp-platform/fpnew.git", version: 0.6.1 }
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.16.4 }
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 needed (the fifo from common_cells was copied; is another cell from that repos now used)?

tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git", version: 0.1.1 }

sources:
Expand All @@ -14,6 +15,7 @@ sources:
- rtl/cv32e40p_register_file_test_wrap.sv
- rtl/cv32e40p_alu.sv
- rtl/cv32e40p_alu_div.sv
- rtl/cv32e40p_aligner.sv
- rtl/cv32e40p_compressed_decoder.sv
- rtl/cv32e40p_controller.sv
- rtl/cv32e40p_cs_registers.sv
Expand All @@ -28,7 +30,6 @@ sources:
- rtl/cv32e40p_mult.sv
- rtl/cv32e40p_prefetch_buffer.sv
- rtl/cv32e40p_obi_interface.sv
- rtl/cv32e40p_prefetch_controller.sv
- rtl/cv32e40p_core.sv
- rtl/cv32e40p_apu_disp.sv
- rtl/cv32e40p_fetch_fifo.sv
Expand Down
2 changes: 1 addition & 1 deletion bhv/cv32e40p_wrapper.sv
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ module cv32e40p_wrapper import cv32e40p_apu_core_pkg::*;
.imm_vs_type ( id_stage_i.imm_vs_type ),
.imm_vu_type ( id_stage_i.imm_vu_type ),
.imm_shuffle_type ( id_stage_i.imm_shuffle_type ),
.imm_clip_type ( id_stage_i.instr_rdata_i[11:7] )
.imm_clip_type ( id_stage_i.instr[11:7] )
);

`endif
Expand Down
4 changes: 2 additions & 2 deletions cv32e40p_manifest.flist
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ ${DESIGN_RTL_DIR}/cv32e40p_cs_registers.sv
${DESIGN_RTL_DIR}/cv32e40p_register_file_ff.sv
${DESIGN_RTL_DIR}/cv32e40p_load_store_unit.sv
${DESIGN_RTL_DIR}/cv32e40p_id_stage.sv
${DESIGN_RTL_DIR}/cv32e40p_aligner.sv
${DESIGN_RTL_DIR}/cv32e40p_decoder.sv
${DESIGN_RTL_DIR}/cv32e40p_compressed_decoder.sv
${DESIGN_RTL_DIR}/cv32e40p_fetch_fifo.sv
${DESIGN_RTL_DIR}/cv32e40p_fifo.sv
${DESIGN_RTL_DIR}/cv32e40p_prefetch_buffer.sv
${DESIGN_RTL_DIR}/cv32e40p_hwloop_regs.sv
${DESIGN_RTL_DIR}/cv32e40p_hwloop_controller.sv
${DESIGN_RTL_DIR}/cv32e40p_mult.sv
${DESIGN_RTL_DIR}/cv32e40p_register_file_test_wrap.sv
${DESIGN_RTL_DIR}/cv32e40p_int_controller.sv
Expand Down
33 changes: 30 additions & 3 deletions example_tb/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ RISCV_EXE_PREFIX = $(RISCV)/bin/riscv32-unknown-elf-

# GCC configuration
CUSTOM_GCC_FLAGS =
INTERRUPT_GCC_FLAGS =

all: custom-vsim-run

Expand Down Expand Up @@ -229,7 +228,7 @@ custom-fp-vsim-run-gui: vsim-run-gui-fp
# compile and run interrupt
interrupt/interrupt.elf: interrupt/interrupt.c
$(RISCV_EXE_PREFIX)gcc -march=rv32imc -o $@ -w -Os -g -nostdlib \
${INTERRUPT_GCC_FLAGS} \
${CUSTOM_GCC_FLAGS} \
-T custom/link.ld \
-static \
custom/crt0.S \
Expand All @@ -252,6 +251,34 @@ interrupt-vsim-run-gui: vsim-all interrupt/interrupt.hex
interrupt-vsim-run-gui: ALL_VSIM_FLAGS += "+firmware=interrupt/interrupt.hex"
interrupt-vsim-run-gui: vsim-run-gui

# Compile and run HW-loops test
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be moved to core-v-verif right away? We are trying to keep this Makefile as minimal as possible (ideally only 'hello world')

# Until the compiler will correctly handle HW-loops, manually insert them (no jumps/branch in the body)
# Compile with "rv32imxpulpv2" with "-mnohwloop" or "-O0" to avoid the compiler inserting other hw-loops
# Do not use RVC, as the instructions should be aligned and not compressed
hwlp_test/hwlp_test.elf: hwlp_test/hwlp_test.c
$(RISCV_EXE_PREFIX)gcc -march=rv32imxpulpv2 -mnohwloop -o $@ -w -O0 -g -nostdlib \
$(CUSTOM_GCC_FLAGS) \
-T custom/link.ld \
-static \
custom/crt0.S \
$^ mem_stall/mem_stall.c custom/syscalls.c custom/vectors.S \
-I $(RISCV)/riscv32-unknown-elf/include \
-I mem_stall \
-L $(RISCV)/riscv32-unknown-elf/lib \
-lc -lm -lgcc
hwlp-clean:
rm -rf hwlp_test/hwlp_test.elf hwlp_test/hwlp_test.hex

.PHONY: hwlp-vsim-run
hwlp-vsim-run: vsim-all hwlp_test/hwlp_test.hex
hwlp-vsim-run: ALL_VSIM_FLAGS += "+firmware=hwlp_test/hwlp_test.hex"
hwlp-vsim-run: vsim-run

.PHONY: hwlp-vsim-run-gui
hwlp-vsim-run-gui: vsim-all hwlp_test/hwlp_test.hex
hwlp-vsim-run-gui: ALL_VSIM_FLAGS += "+firmware=hwlp_test/hwlp_test.hex"
hwlp-vsim-run-gui: vsim-run-gui

# general targets
.PHONY: clean
clean: tb-clean tb-clean-fp custom-clean custom-fp-clean interrupt-clean
clean: tb-clean tb-clean-fp custom-clean custom-fp-clean interrupt-clean hwlp-clean
1 change: 1 addition & 0 deletions example_tb/core/custom/hello_world.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>

#include "mem_stall.h"

int main(int argc, char *argv[])
Expand Down
26 changes: 18 additions & 8 deletions example_tb/core/cv32e40p_random_interrupt_generator.sv
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,24 @@ begin
max_irq_cycles = irq_max_cycles_i;

// generate random word and mask it with lower/upper bounds
temp = value.randomize();
for(int i = min_irq_id-1; i >= 0; i--) begin
value.rand_word[i] = 0;
end

for(int i = max_irq_id+1; i <= 31; i++) begin
value.rand_word[i] = 0;
end
do begin
temp = value.randomize();

// These lines are not used by the processor
value.rand_word[2:0] = '0;
value.rand_word[6:4] = '0;
value.rand_word[10:8] = '0;
value.rand_word[15:12] = '0;

for(int i = min_irq_id-1; i >= 0; i--) begin
value.rand_word[i] = 0;
end

for(int i = max_irq_id+1; i <= 31; i++) begin
value.rand_word[i] = 0;
end
// Randomize again if value.rand_word == '0, because irq_line should be one-hot
end while (!(|value.rand_word));

temp = wait_cycles.randomize() with{
n >= min_irq_cycles;
Expand Down
14 changes: 8 additions & 6 deletions example_tb/core/cv32e40p_random_stall.sv
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ class rand_data_cycles;
rand int n;
endclass : rand_data_cycles

mailbox #(stall_mem_t) core_reqs = new (4);
mailbox #(stall_mem_t) core_resps = new (4);
mailbox #(logic) core_resps_granted = new (4);
mailbox #(stall_mem_t) memory_transfers = new (4);
mailbox #(stall_mem_t) core_reqs = new ();
mailbox #(stall_mem_t) core_resps = new ();
mailbox #(logic) core_resps_granted = new ();
mailbox #(stall_mem_t) memory_transfers = new ();

always_latch
begin
Expand Down Expand Up @@ -129,8 +129,10 @@ always_latch
#10;//wait at the very beginning
while(1) begin
@(posedge clk_i);
#1;
grant_core_o = 1'b0;

Copy link
Contributor

@Silabs-ArjanB Silabs-ArjanB Aug 12, 2020

Choose a reason for hiding this comment

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

Can you explain this change? Actually, why was there a #1 at all, is it to prevent erroneous fall through on the 'wait'? (Same question for the #1 uses below)

#1;

if (!req_per_q) begin
wait(req_per_q == 1'b1);
end
Expand Down Expand Up @@ -178,10 +180,10 @@ always_latch

while(1) begin
@(posedge clk_i);
#1;
rvalid_core_o = 1'b0;
rdata_core_o = 'x;

#1;
core_resps_granted.get(granted);

core_resps.get(mem_acc);
Expand Down
Loading