Skip to content

Commit

Permalink
Merge branch 'main' into readthedocs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseCalero authored Oct 5, 2023
2 parents 7d35060 + beee13e commit 65a7eb4
Show file tree
Hide file tree
Showing 44 changed files with 4,193 additions and 1,229 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ mcu-gen:
$(PYTHON) util/mcu_gen.py --cfg $(MCU_CFG) --pads_cfg $(PAD_CFG) --outdir hw/ip/power_manager/rtl --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --external_domains $(EXTERNAL_DOMAINS) --pkg-sv hw/ip/power_manager/data/power_manager.sv.tpl
$(PYTHON) util/mcu_gen.py --cfg $(MCU_CFG) --pads_cfg $(PAD_CFG) --outdir hw/ip/power_manager/data --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --external_domains $(EXTERNAL_DOMAINS) --pkg-sv hw/ip/power_manager/data/power_manager.hjson.tpl
bash -c "cd hw/ip/power_manager; source power_manager_gen.sh; cd ../../../"
$(PYTHON) util/mcu_gen.py --cfg mcu_cfg.hjson --pads_cfg $(PAD_CFG) --outdir sw/device/lib/drivers/power_manager --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --external_domains $(EXTERNAL_DOMAINS) --pkg-sv sw/device/lib/drivers/power_manager/data/power_manager.h.tpl
$(PYTHON) util/mcu_gen.py --cfg mcu_cfg.hjson --pads_cfg $(PAD_CFG) --outdir hw/system/pad_control/data --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --external_pads $(EXT_PAD_CFG) --pkg-sv hw/system/pad_control/data/pad_control.hjson.tpl
$(PYTHON) util/mcu_gen.py --cfg mcu_cfg.hjson --pads_cfg $(PAD_CFG) --outdir hw/system/pad_control/rtl --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --external_pads $(EXT_PAD_CFG) --pkg-sv hw/system/pad_control/rtl/pad_control.sv.tpl
$(PYTHON) util/mcu_gen.py --cfg $(MCU_CFG) --pads_cfg $(PAD_CFG) --outdir sw/device/lib/drivers/power_manager --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --external_domains $(EXTERNAL_DOMAINS) --pkg-sv sw/device/lib/drivers/power_manager/data/power_manager.h.tpl
$(PYTHON) util/mcu_gen.py --cfg $(MCU_CFG) --pads_cfg $(PAD_CFG) --outdir hw/system/pad_control/data --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --external_pads $(EXT_PAD_CFG) --pkg-sv hw/system/pad_control/data/pad_control.hjson.tpl
$(PYTHON) util/mcu_gen.py --cfg $(MCU_CFG) --pads_cfg $(PAD_CFG) --outdir hw/system/pad_control/rtl --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --external_pads $(EXT_PAD_CFG) --pkg-sv hw/system/pad_control/rtl/pad_control.sv.tpl
bash -c "cd hw/system/pad_control; source pad_control_gen.sh; cd ../../../"
$(PYTHON) util/mcu_gen.py --cfg mcu_cfg.hjson --pads_cfg $(PAD_CFG) --outdir sw/linker --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --linker_script sw/linker/link_flash_exec.ld.tpl
$(PYTHON) util/mcu_gen.py --cfg mcu_cfg.hjson --pads_cfg $(PAD_CFG) --outdir sw/linker --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --linker_script sw/linker/link_flash_load.ld.tpl
$(PYTHON) util/mcu_gen.py --cfg $(MCU_CFG) --pads_cfg $(PAD_CFG) --outdir sw/linker --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --linker_script sw/linker/link_flash_exec.ld.tpl
$(PYTHON) util/mcu_gen.py --cfg $(MCU_CFG) --pads_cfg $(PAD_CFG) --outdir sw/linker --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --linker_script sw/linker/link_flash_load.ld.tpl
$(PYTHON) ./util/structs_periph_gen.py
$(MAKE) verible

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ make mcu-gen CPU=cv32e40p BUS=NtoM MEMORY_BANKS=12 MEMORY_BANKS_IL=4
The last command generates x-heep with the cv32e40p core, with a parallel bus, and 16 memory banks (12 continuous and 4 interleaved),
each 32KB, for a total memory of 512KB.

If you are using `X-HEEP` just as a controller for your own system and you do not need any peripheral, you can use the `minimal` configuration file
when generating the MCU as:

```
make mcu-gen MCU_CFG=mcu_cfg_minimal.hjson
```

The `minimal` configuration is a work-in-progress, thus not all the APPs have been tested.


## Compiling Software

Don't forget to set the `RISCV` env variable to the compiler folder (without the `/bin` included).
Expand Down
8 changes: 6 additions & 2 deletions docs/source/How_to/eXtendingHEEP.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ The following is an example repository folder structure.
│ │ ├── your_copro.h
│ │ └── your_copro_defs.h -> ../../../../hw/vendor/your_copro/sw/your_copro_defs.h
│ └── extensions
│ └── your_copro_x_heep.h
│ │ └── your_copro_x_heep.h
│ └── lib
│ └── crt
│ └── external_crt0.S
├── hw
│ └── vendor
│ ├── your_copro
Expand Down Expand Up @@ -276,8 +279,9 @@ In the `external` folder you can add whatever is necessary for software to work

* Sources and header files
* Soft links to folders or files.
* A `lib/crt/` directory with and `exteral_crt0.S` file (will be included inside `BASW/sw/device/lib/crt/crt0.S`).

The external folder or any of its subdirectories cannot contain neither a `device` nor a `applications` folder as it would collide with the respective folders inside `BASE/sw/`. It should also not contain a `main.c` file.
The external folder or any of its subdirectories cannot contain neither a `device` nor an `applications` folder as it would collide with the respective folders inside `BASE/sw/`. It should also not contain a `main.c` file.

### The BASE/Makefile
The `BASE/Makefile` is your own custom Makefile. You can use it as a bridge to access the Makefile from `X-HEEP`.
Expand Down
10 changes: 7 additions & 3 deletions hw/core-v-mini-mcu/peripheral_subsystem.sv.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,11 @@ module peripheral_subsystem
);
% else:
assign msip_o = '0;
assign irq_id = '0;

for(genvar i=0; i<rv_plic_reg_pkg::NumTarget; i=i+1) begin
assign irq_id[i] = '0;
end
assign irq_plic_o = '0;
assign plic_tl_d2h = '0;
% endif
Expand Down Expand Up @@ -536,8 +540,8 @@ module peripheral_subsystem
assign i2s_ws_o = 1'b0;
assign i2s_sd_oe_o = 1'b0;
assign i2s_sd_o = 1'b0;
assign intr_i2s_event = 1'b0;
assing i2s_rx_valid_o = 1'b0;
assign i2s_intr_event = 1'b0;
assign i2s_rx_valid_o = 1'b0;
% endif
% endif
% endfor
Expand Down
2 changes: 1 addition & 1 deletion hw/vendor/esl_epfl_cv32e40px.lock.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
upstream:
{
url: https://github.com/esl-epfl/cv32e40px.git
rev: bfb6b76b19e036ade7265eb78ac15b733f0d758a
rev: 326891e200365b2558511e6deb8e444eb8daf977
}
}
2 changes: 1 addition & 1 deletion hw/vendor/esl_epfl_cv32e40px.vendor.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

upstream: {
url: "https://github.com/esl-epfl/cv32e40px.git",
rev: "bfb6b76b19e036ade7265eb78ac15b733f0d758a",
rev: "326891e200365b2558511e6deb8e444eb8daf977",
},

patch_dir: "patches/esl_epfl_cv32e40px",
Expand Down
13 changes: 9 additions & 4 deletions hw/vendor/esl_epfl_cv32e40px/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@

version: 2

#build:
# os: "ubuntu-20.04"
# tools:
# python: "3.9"
build:
os: "ubuntu-20.04"
tools:
python: "3.9"

# Build from the docs/source directory with Sphinx
sphinx:
configuration: docs/source/conf.py

formats:
- htmlzip
- pdf
- epub

# Explicitly set the Python requirements
python:
install:
Expand Down
80 changes: 40 additions & 40 deletions hw/vendor/esl_epfl_cv32e40px/bhv/cv32e40px_instr_trace.svh
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class instr_trace_t;
regs_read.push_back('{rs2, rs2_value, 0});
regs_write.push_back('{rd, 'x, 0});
str = $sformatf(
"%-16s %s, %s, %s, 0x%0d", mnemonic, regAddrToStr(rd), regAddrToStr(rs1), regAddrToStr(rs2), $unsigned(imm_s3_type[4:0])
"%-16s %s, %s, %s, 0x%0h", mnemonic, regAddrToStr(rd), regAddrToStr(rs1), regAddrToStr(rs2), $unsigned(imm_s3_type[4:0])
);
end
endfunction // printAddNInstr
Expand Down Expand Up @@ -760,103 +760,103 @@ class instr_trace_t;
case (instr[31:26])
6'b000000: begin
mnemonic = "cv.add";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b000010: begin
mnemonic = "cv.sub";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b000100: begin
mnemonic = "cv.avg";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b000110: begin
mnemonic = "cv.avgu";
str_imm = $sformatf("0x%0d", imm_vu_type);
str_imm = $sformatf("0x%0h", imm_vu_type);
end
6'b001000: begin
mnemonic = "cv.min";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b001010: begin
mnemonic = "cv.minu";
str_imm = $sformatf("0x%0d", imm_vu_type);
str_imm = $sformatf("0x%0h", imm_vu_type);
end
6'b001100: begin
mnemonic = "cv.max";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b001110: begin
mnemonic = "cv.maxu";
str_imm = $sformatf("0x%0d", imm_vu_type);
str_imm = $sformatf("0x%0h", imm_vu_type);
end
6'b010000: begin
mnemonic = "cv.srl";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b010010: begin
mnemonic = "cv.sra";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b010100: begin
mnemonic = "cv.sll";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b010110: begin
mnemonic = "cv.or";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b011000: begin
mnemonic = "cv.xor";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b011010: begin
mnemonic = "cv.and";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b011100: begin
mnemonic = "cv.abs";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
// dot products
6'b100000: begin
mnemonic = "cv.dotup";
str_imm = $sformatf("0x%0d", imm_vu_type);
str_imm = $sformatf("0x%0h", imm_vu_type);
end
6'b100010: begin
mnemonic = "cv.dotusp";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b100100: begin
mnemonic = "cv.dotsp";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b100110: begin
mnemonic = "cv.sdotup";
str_imm = $sformatf("0x%0d", imm_vu_type);
str_imm = $sformatf("0x%0h", imm_vu_type);
end
6'b101000: begin
mnemonic = "cv.sdotusp";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b101010: begin
mnemonic = "cv.sdotsp";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end

6'b101110: begin
case (instr[14:13])
2'b00 : begin
mnemonic = "cv.extract";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
2'b01 : begin
mnemonic = "cv.extractu";
str_imm = $sformatf("0x%0d", imm_vu_type);
str_imm = $sformatf("0x%0h", imm_vu_type);
end
2'b10 : begin
mnemonic = "cv.insert";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
endcase
str_sci = "";
Expand All @@ -866,25 +866,25 @@ class instr_trace_t;
6'b110000: begin
if (instr[14:12] == 3'b111) begin
mnemonic = "cv.shuffleI0";
str_imm = $sformatf("0x%0d", imm_shuffle_type);
str_imm = $sformatf("0x%8h", imm_shuffle_type);
end else begin
mnemonic = "cv.shuffle";
if (instr[14:12] == 3'b110) begin
str_imm = $sformatf("0x%0d", imm_shuffle_type);
str_imm = $sformatf("0x%8h", imm_shuffle_type);
end
end
end
6'b110010: begin
mnemonic = "cv.shuffleI1";
str_imm = $sformatf("0x%0d", imm_shuffle_type);
str_imm = $sformatf("0x%8h", imm_shuffle_type);
end
6'b110100: begin
mnemonic = "cv.shuffleI2";
str_imm = $sformatf("0x%0d", imm_shuffle_type);
str_imm = $sformatf("0x%8h", imm_shuffle_type);
end
6'b110110: begin
mnemonic = "cv.shuffleI3";
str_imm = $sformatf("0x%0d", imm_shuffle_type);
str_imm = $sformatf("0x%8h", imm_shuffle_type);
end
6'b111000: begin
mnemonic = "cv.shuffle2";
Expand All @@ -902,43 +902,43 @@ class instr_trace_t;
// comparisons
6'b000001: begin
mnemonic = "cv.cmpeq";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b000011: begin
mnemonic = "cv.cmpne";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b000101: begin
mnemonic = "cv.cmpgt";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b000111: begin
mnemonic = "cv.cmpge";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b001001: begin
mnemonic = "cv.cmplt";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b001011: begin
mnemonic = "cv.cmple";
str_imm = $sformatf("0x%0d", imm_vs_type);
str_imm = $sformatf("0x%0h", imm_vs_type);
end
6'b001101: begin
mnemonic = "cv.cmpgtu";
str_imm = $sformatf("0x%0d", imm_vu_type);
str_imm = $sformatf("0x%0h", imm_vu_type);
end
6'b001111: begin
mnemonic = "cv.cmpgeu";
str_imm = $sformatf("0x%0d", imm_vu_type);
str_imm = $sformatf("0x%0h", imm_vu_type);
end
6'b010001: begin
mnemonic = "cv.cmpltu";
str_imm = $sformatf("0x%0d", imm_vu_type);
str_imm = $sformatf("0x%0h", imm_vu_type);
end
6'b010011: begin
mnemonic = "cv.cmpleu";
str_imm = $sformatf("0x%0d", imm_vu_type);
str_imm = $sformatf("0x%0h", imm_vu_type);
end

6'b010101: begin
Expand Down
Loading

0 comments on commit 65a7eb4

Please sign in to comment.