Skip to content

Commit

Permalink
removed FEMU (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
simone-machetti authored Jan 11, 2024
1 parent 18596ac commit f87b62c
Show file tree
Hide file tree
Showing 23 changed files with 36 additions and 3,252 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ build/
*.dis
*.map
*.do
.venv/*
.venv/
util/__pycache__/*

# ignore apps output file
run_verif_rtl_log.txt

#ignore femu generated hw
linux_femu/rtl/linux_femu.sv
.venv/

# ignore the following hw automatically generated files
environment.yml
core-v-mini-mcu.upf
Expand Down
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@ conda: environment.yml
environment.yml: python-requirements.txt
util/python-requirements2conda.sh

## @section Linux-Emulation

## Generates FEMU
linux-femu-gen: mcu-gen
$(PYTHON) util/mcu_gen.py --cfg $(MCU_CFG) --pads_cfg $(PAD_CFG) --outdir linux_femu/rtl/ --tpl-sv linux_femu/rtl/linux_femu.sv.tpl
$(MAKE) verible

## @section Installation

## Generates mcu files core-v-mini-mcu files and build the design with fusesoc
Expand Down
31 changes: 10 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ It has been tested only on `Ubuntu 20`, and we know it does NOT WORK on `Ubuntu

## 2. Python


We rely on either (a) `miniconda`, or (b) `virtual environment` enviroment.

Choose between `2.a` or `2.b` to setup your enviroment.
Expand All @@ -79,7 +78,6 @@ You need to do it only the first time, then just activate the environment everyt
conda activate core-v-mini-mcu
```


### 2.b Virtual Environment

Install the python virtual environment just as:
Expand Down Expand Up @@ -206,7 +204,6 @@ 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 Expand Up @@ -238,7 +235,6 @@ make app TARGET=pynq-z2

Or, if you use the OpenHW Group [GCC](https://www.embecosm.com/resources/tool-chain-downloads/#corev) compiler with CORE_PULP extensions, make sure to point the `RISCV` env variable to the OpenHW Group compiler, then just run:


```
make app COMPILER_PREFIX=riscv32-corev- ARCH=rv32imc_zicsr_zifencei_xcvhwlp1p0_xcvmem1p0_xcvmac1p0_xcvbi1p0_xcvalu1p0_xcvsimd1p0_xcvbitmanip1p0
```
Expand Down Expand Up @@ -296,7 +292,6 @@ or to execute all these three steps type:
make run-helloworld
```


### Compiling for VCS

To simulate your application with VCS, first compile the HDL:
Expand Down Expand Up @@ -427,7 +422,6 @@ The available parameters are:
* LINKER: `on_chip`(default), `flash_load` or `flash_exec` (can provide more than one)
* TIMEOUT: Integer number of seconds (default 120)


#### Usage

##### Comands
Expand All @@ -440,7 +434,7 @@ make app-simulate-all
```
Note that both commands allow the previous parameters to specify compiling or simulation options. E.g.:
```
make app-simulate-all LINKER=on_chip SIMULATOR=questasim COMPILER=clang TIMEOUT=150
make app-simulate-all LINKER=on_chip SIMULATOR=questasim COMPILER=clang TIMEOUT=150
```

##### Manually
Expand Down Expand Up @@ -477,16 +471,17 @@ Follow the [ExecuteFromFlash](./ExecuteFromFlash.md) guide to exxecute code dire

## Emulation on Xilinx FPGAs

This project offers two different X-HEEP implementetions on the Xilinx FPGAs, called Standalone-FEMU and Linux-FEMU.
This project offers two different X-HEEP implementetions on Xilinx FPGAs, called Standalone and FEMU.

### Standalone-FEMU (Standalone Fpga EMUlation)
### Standalone

In this version, the X-HEEP architecture is implemented on the programmable logic (PL) side of the FPGA, and its input/output are connected to the available headers on the FPGA board.
Two FPGA boards are actually supported: the Xilinx Pynq-z2 and Nexys-A7-100t.

Two FPGA boards are supported: the Xilinx Pynq-z2 and Nexys-A7-100t.

Make sure you have the FPGA board files installed in your Vivado.

For example, for the Xilinx Pynq-Z2 board, use the documentation provided at the following [link](https://pynq.readthedocs.io/en/v2.5/overlay_design_methodology/board_settings.html) to download and install them:
For example, for the Pynq-Z2 board, use the documentation provided at the following [link](https://pynq.readthedocs.io/en/v2.5/overlay_design_methodology/board_settings.html) to download and install them:

To build and program the bitstream for your FPGA with vivado, type:

Expand Down Expand Up @@ -535,13 +530,11 @@ To look at the output of your printf, run in another terminal:

Please be sure to use the right `ttyUSB` number (you can discover it with `dmesg --time-format iso | grep FTDI` for example).

### FPGA EMUlation Platform (FEMU)

### Linux-FEMU (Linux Fpga EMUlation)

In this version, the X-HEEP architecture is implemented on the programmable logic (PL) side of the FPGA and Linux is run on the ARM-based processing system (PS) side of the same chip.

Read the [following](./linux_femu/README.md) documentation to have more information about this implementation.
In this version, the X-HEEP architecture is implemented on the programmable logic (PL) side of the Xilinx Zynq-7020 chip on the Pynq-Z2 board and Linux is run on the ARM-based processing system (PS) side of the same chip.

NOTE: This platform is not part of this repository, but you can access it with the following link: [FEMU](https://github.com/esl-epfl/x-heep-femu-sdk).

# ASIC Implementation

Expand All @@ -568,9 +561,5 @@ This relies on a fork of [edalize](https://github.com/davideschiavone/edalize) t

## References

1. [Schiavone, Pasquale Davide, et al. "X-HEEP: An Open-Source, Configurable and Extendible RISC-V Microcontroller."
1. [Schiavone, Pasquale Davide, et al. "X-HEEP: An Open-Source, Configurable and Extendible RISC-V Microcontroller."
Proceedings of the 20th ACM International Conference on Computing Frontiers. 2023.](https://dl.acm.org/doi/pdf/10.1145/3587135.3591431?casa_token=cAs3isVd0zkAAAAA:gmQBe3ip7X0Fz0hO8lSFbGN5-2fdu5vni1dxWWAIe9zCxQDW1PPerubUigOcl_an8HiZOhPuNrwzIw8)




31 changes: 0 additions & 31 deletions core-v-mini-mcu.core
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,6 @@ filesets:
- hw/fpga/scripts/nexys/set_board.tcl: { file_type: tclSource }
- hw/fpga/scripts/nexys/xilinx_generate_clk_wizard.tcl: { file_type: tclSource }

fpga-arm-emulation:
depend:
- pulp-platform.org::axi_spi_slave
files:
- linux_femu/scripts/xilinx_generate_processing_system.tcl: {file_type: tclSource}
- linux_femu/rtl/axi_address_hijacker.v: {file_type: verilogSource}
- linux_femu/rtl/linux_femu.sv: {file_type: systemVerilogSource}
- linux_femu/constraints/pin_assign.xdc: {file_type: xdc}
- linux_femu/constraints/constraints.xdc: {file_type: xdc}

ip-asic:
depend:
- technology::prim_mytech
Expand Down Expand Up @@ -433,27 +423,6 @@ targets:
part: xc7z020clg400-1
toplevel: [xilinx_core_v_mini_mcu_wrapper]

pynq-z2-arm-emulation:
<<: *default_target
default_tool: vivado
description: TUL Pynq-Z2 Board
filesets_append:
- x_heep_system
- rtl-fpga
- ip-fpga
- fpga-arm-emulation
parameters:
- COREV_PULP
- FPU
- X_EXT
- SYNTHESIS=true
- REMOVE_OBI_FIFO
tools:
vivado:
part: xc7z020clg400-1
jobs: 4
toplevel: [linux_femu]

asic_synthesis:
<<: *default_target
default_tool: design_compiler
Expand Down
34 changes: 25 additions & 9 deletions docs/source/How_to/CompileMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ or to execute all these three steps type:
make run-helloworld
```


### Compiling for VCS

To simulate your application with VCS, first compile the HDL:
Expand Down Expand Up @@ -238,7 +237,6 @@ The available parameters are:
* LINKER: `on_chip`(default), `flash_load` or `flash_exec` (can provide more than one)
* TIMEOUT: Integer number of seconds (default 120)


#### Usage

##### Comands
Expand Down Expand Up @@ -286,22 +284,30 @@ Follow the [ExecuteFromFlash](./ExecuteFromFlash.md) guide to exxecute code dire

## Emulation on Xilinx FPGAs

This project offers two different X-HEEP implementetions on the Xilinx FPGAs, called Standalone-FEMU and Linux-FEMU.
This project offers two different X-HEEP implementetions on Xilinx FPGAs, called Standalone and FEMU.

### Standalone-FEMU (Standalone Fpga EMUlation)
### Standalone

In this version, the X-HEEP architecture is implemented on the programmable logic (PL) side of the FPGA, and its input/output are connected to the available headers on the FPGA board.

Two FPGA boards are supported: the Xilinx Pynq-z2 and Nexys-A7-100t.

Make sure you have the FPGA board files installed in your Vivado.

For example, for the Xilinx Pynq-Z2 board, use the documentation provided at the following [link](https://pynq.readthedocs.io/en/v2.5/overlay_design_methodology/board_settings.html) to download and install them:
For example, for the Pynq-Z2 board, use the documentation provided at the following [link](https://pynq.readthedocs.io/en/v2.5/overlay_design_methodology/board_settings.html) to download and install them:

To build and program the bitstream for your FPGA with vivado, type:

```
make vivado-fpga FPGA_BOARD=pynq-z2
```

or

```
make vivado-fpga FPGA_BOARD=nexys-a7-100t
```

or add the flag `use_bscane_xilinx` to use the native Xilinx scanchain:

```
Expand All @@ -323,12 +329,22 @@ to load the binaries with the HS2 cable over JTAG,
or follow the [ExecuteFromFlash](./ExecuteFromFlash.md)
guide if you have a FLASH attached to the FPGA.


Do not forget that the `pynq-z2` board requires you to have the ethernet cable attached to the board while running.

For example, if you want to run your application using flash_exec, do as follow:

compile your application, e.g. `make app PROJECT=example_matfadd TARGET=pynq-z2 ARCH=rv32imfc LINKER=flash_exec`

and then follow the [ExecuteFromFlash](./ExecuteFromFlash.md) to program the flash and set the boot buttons on the FPGA correctly.

To look at the output of your printf, run in another terminal:

`picocom -b 9600 -r -l --imap lfcrlf /dev/ttyUSB2`

Please be sure to use the right `ttyUSB` number (you can discover it with `dmesg --time-format iso | grep FTDI` for example).

### Linux-FEMU (Linux Fpga EMUlation)
### FPGA EMUlation Platform (FEMU)

In this version, the X-HEEP architecture is implemented on the programmable logic (PL) side of the FPGA and Linux is run on the ARM-based processing system (PS) side of the same chip.
In this version, the X-HEEP architecture is implemented on the programmable logic (PL) side of the Xilinx Zynq-7020 chip on the Pynq-Z2 board and Linux is run on the ARM-based processing system (PS) side of the same chip.

Read the [following](./linux_femu/README.md) documentation to have more information about this implementation.
NOTE: This platform is not part of this repository, but you can access it with the following link: [FEMU](https://github.com/esl-epfl/x-heep-femu-sdk).
Loading

0 comments on commit f87b62c

Please sign in to comment.