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

add script to simulate all apps #341

Merged
merged 30 commits into from
Jul 27, 2023
Merged

Conversation

JuanSapriza
Copy link
Contributor

@JuanSapriza JuanSapriza commented Jul 6, 2023

I have added an script to build and simulate all apps.

Usage

Make sure the script is executable

sudo chmod u+x test_all.sh

Then source the script and enjoy

. test_all.sh

Considerations

  • The execution takes some time
  • Currently the script has some fixed parameters:
    • Simulator: Verilator
    • Environment: activates a conda environment named core-v-mini-mcu
    • Linker: On Chip (JTAG) for all simulations
    • Compiler: CLANG and/or GCC (if both are installed, tries both, simulates with GCC)
  • The simulation model is built with the following configurations to guarantee all apps can be run (at least to that extent)
    • MEMORY_BANKS=3
    • EXTERNAL-DOMAINS=1
  • during the mcu-gen with the above parameters, some files are modified. To aid the user, by the end of the execution it is possible to git stash drop them. This action is optional, but its highly recommended to commit before running the script to avoid having to manually pick the changes to keep.
  • Some applications that cannot be run with verilator were added to a blacklist so they are not simulated. Some others were not (as to show the functionality.

Pending features

  • Select the simulator
  • ⚠️ Fix apps that never finish testing on one simulator
    • example_virtual_flash
    • example_freertos_blinky
    • example_spi_*
  • Keep a count of apps that performed a meaningless execution (returned success because the requirements were not met)
  • Try different linkers
  • Allow modification of certain parameters

@JuanSapriza
Copy link
Contributor Author

The script is working well for me.
Some interesting tests include:

  • Introducing a bug into an app to make it fail the simulation
  • Introducing a bug into an app to make it fail the compilation
  • Adding/removing apps from the blacklist
  • Trying clang
  • Trying a different simulator (if that is tested, I can add it to the script)

@JuanSapriza JuanSapriza marked this pull request as ready for review July 10, 2023 12:29
@davideschiavone
Copy link
Member

shall I merge this? do we have an option to specify the LINKER Script and the Target simulator?

@JuanSapriza
Copy link
Contributor Author

I did not implement any of those to make it as straight forward as possible, so we can start using it.

I would say you (or someone else) tries it as-is. If it works, I would merge and then we can start adding some other features.

@davideschiavone
Copy link
Member

davideschiavone commented Jul 17, 2023

i would rather do it now, at least the simulator (questa or verilator) and the linker script.
Also, right now both the compilers are used (clag and gcc), whereas I would leave this as an option again.

Then the CI can use both the options.

@davideschiavone
Copy link
Member

davideschiavone commented Jul 19, 2023

Also,

  • delete old run verif script
  • mention about this script in README (included how to lauch it)

@JuanSapriza
Copy link
Contributor Author

JuanSapriza commented Jul 20, 2023

The things to do (i cannot check the ones in Davide's comment):

  • delete old run verif script
  • mention about this script in README (included how to launch it)
  • Discard the compiler existence check
  • Check what happens if the environment is already active
  • Let the user choose linker and target simulator

@JuanSapriza
Copy link
Contributor Author

JuanSapriza commented Jul 20, 2023

So far i have tried:

  • with and without the environment active
  • verilator and questasim (on my pc and eslsrv)
  • the different linkers

@davidmallasen is now testing clang

We noticed the important of sourcing for the conda activate command can be run properly (this is included in the documentation)

@JuanSapriza
Copy link
Contributor Author

David tested clang and questasim and its working for him.

I also added the possibility of changing the timeout.

@davideschiavone Could you read the README modifications and try running it based on that?

@davideschiavone davideschiavone changed the title Script to simulate all apps add script to simulate all apps Jul 20, 2023
@JuanSapriza
Copy link
Contributor Author

⚠️ Important!

The scripts needs to be SOURCED by calling it as . test_all.sh (not the period . at the beginning)

@davideschiavone could you try it now?

test_all.sh Outdated Show resolved Hide resolved
@davideschiavone davideschiavone merged commit 9dff465 into esl-epfl:main Jul 27, 2023
@JuanSapriza JuanSapriza deleted the pr_sim_all branch July 27, 2023 13:49
JuanSapriza added a commit to JuanSapriza/HEEPsilon that referenced this pull request Oct 5, 2023
Update code from upstream repository https://github.com/esl-
epfl/x-heep.git to revision 086884bed017d7778d1c6309533fdf0505a220e2

* Improved the comments on the eXtendingHEEP readme (esl-
  epfl/x-heep#360) (JuanSapriza)
* Modified the way of realizing if an app is external or not
  (JuanSapriza)
* add script to simulate all apps (esl-epfl/x-heep#341) (JuanSapriza)
* [app] fix APPs on flash_exec (esl-epfl/x-heep#357) (Davide
  Schiavone)
* adding attributes and mux pad parameters in mcu-gen (esl-
  epfl/x-heep#349) (Davide Schiavone)
* change signal names in power manager to reflex polarity (esl-
  epfl/x-heep#352) (Simone Machetti)
* fix power gating core app (esl-epfl/x-heep#355) (Davide Schiavone)
* add cv32e40px (esl-epfl/x-heep#353) (Davide Schiavone)
* moved fpnew in its own directory (esl-epfl/x-heep#351) (Davide
  Schiavone)
* update cv32e40p divider (esl-epfl/x-heep#350) (Davide Schiavone)
* fix external pad gen (esl-epfl/x-heep#346) (Davide Schiavone)
* fix mcu-gen (esl-epfl/x-heep#345) (Davide Schiavone)
* update GPIO driver (esl-epfl/x-heep#246) (Hossein Taji)
* fix interleaved bus (esl-epfl/x-heep#340) (Daniel Vázquez)
* fix esl-epfl/x-heep#338 (esl-epfl/x-heep#339) (Davide Schiavone)
* Initialized variables to 0 inside functions. Removed printf comments
  (esl-epfl/x-heep#334) (JuanSapriza)
* made the dma_is_ready() function non-optimizable at all. (esl-
  epfl/x-heep#333) (JuanSapriza)
* fix SPI apps (esl-epfl/x-heep#327) (Davide Schiavone)
* Include x-heep.h to all apps that need it (esl-epfl/x-heep#329)
  (JuanSapriza)
* Added soc_ctrl-reg_top warning to waiver (esl-epfl/x-heep#326)
  (JuanSapriza)
* fix several applications (esl-epfl/x-heep#325) (Davide Schiavone)
* Tries to use cmake3. If that is not available, go ahead with cmake
  (esl-epfl/x-heep#323) (JuanSapriza)
* Improve the timing of cv32e40x by removing the debug triggers (esl-
  epfl/x-heep#324) (David Mallasén Quintana)
* refactoring of examples (esl-epfl/x-heep#322) (JuanSapriza)
* expose internal master ports to external devices (esl-
  epfl/x-heep#268) (Michele Caon)
* Interrupt ID to the intr handlers of the PLIC (esl-epfl/x-heep#315)
  (JuanSapriza)
* add ports to DMA to write to addresses coming from port2 of DMA
  (esl-epfl/x-heep#320) (Davide Schiavone)
* DMA HAL - clean PR (esl-epfl/x-heep#317) (JuanSapriza)
* Cleaning up flags (esl-epfl/x-heep#316) (Davide Schiavone)
* Add support for externally defined external pads in `Makefile` (esl-
  epfl/x-heep#312) (Michele Caon)
* Linker load flash refactor fill memory (esl-epfl/x-heep#294)
  (jmiranda)
* add i2s peripheral (esl-epfl/x-heep#203) (Tim Frey)
* Add example ADC schematic (esl-epfl/x-heep#309) (Cyril)
* Update `cv32e40x` version to `0.9.0` (esl-epfl/x-heep#308) (Michele
  Caon)
* integration of an AMS peripheral example (esl-epfl/x-heep#270)
  (Cyril)
* Update FuseSoC remote (esl-epfl/x-heep#307) (Michele Caon)
* fix USE_SPI_FLASH for FPGA (esl-epfl/x-heep#301) (Davide Schiavone)
* add ifdef peripheral included (esl-epfl/x-heep#288) (Davide
  Schiavone)
* Added command in CI to include all peripherals before building.
  (esl-epfl/x-heep#293) (JuanSapriza)
* fix esl-epfl/x-heep#291 (esl-epfl/x-heep#292) (Davide Schiavone)
* fix example_power_gating_core app (esl-epfl/x-heep#286) (Simone
  Machetti)
* fix esl-epfl/x-heep#266 and esl-epfl/x-heep#289 (esl-
  epfl/x-heep#290) (Davide Schiavone)
* Added compilation warning. (esl-epfl/x-heep#287) (Simone Machetti)
* fix Linux FEMU (esl-epfl/x-heep#285) (Simone Machetti)
* added logo (esl-epfl/x-heep#283) (Simone Machetti)
* update cv32e40p (esl-epfl/x-heep#269) (Davide Schiavone)
* Add makefile variable for compiler prefix (esl-epfl/x-heep#278)
  (David Mallasén Quintana)
* CI to verify that apps can be built on every push/PR (esl-
  epfl/x-heep#239) (JuanSapriza)
* App fix + sh compilation script (esl-epfl/x-heep#267) (jmiranda)
* update common cells (esl-epfl/x-heep#262) (Davide Schiavone)
* crt logic update + CMake backend modifications (esl-epfl/x-heep#264)
  (jmiranda)
* External peripheral app bug fix and refactor (esl-epfl/x-heep#259)
  (Stefano Albini)
* Update CMakebackend (esl-epfl/x-heep#258) (jmiranda)
* rv_plic HAL refactor (esl-epfl/x-heep#240) (Stefano Albini)
* Add LICENSE (davide schiavone)
* Add F-HEEP to the eXtendingHEEP list (esl-epfl/x-heep#257) (David
  Mallasén Quintana)
* add fast interrupt enable register (esl-epfl/x-heep#256) (Tim Frey)
* improved interrupt integration (esl-epfl/x-heep#255) (Tim Frey)
* Peripherals structs _reserved fields renaming (esl-epfl/x-heep#254)
  (Stefano Albini)
* adding bitfield_read/write functions (esl-epfl/x-heep#253) (Hossein
  Taji)
* add interleaved bus (esl-epfl/x-heep#237) (Daniel Vázquez)
* fix parameters when there are no external domains (esl-
  epfl/x-heep#247) (Davide Schiavone)
* Corrected two comments and removed the FIC part in the power gating
  example. (esl-epfl/x-heep#248) (JuanSapriza)
* make example external periph shorter (esl-epfl/x-heep#232) (Davide
  Schiavone)
* Minor modification on Readme (esl-epfl/x-heep#245) (jmiranda)
* Fixing APPs and Compilation issues + FreeRTOS HEAP mem (esl-
  epfl/x-heep#238) (jmiranda)
* updating fast intr ctrl based on structure (esl-epfl/x-heep#235)
  (Hossein Taji)
* [hw] adding peripheral inclusion/exclusion configuration (esl-
  epfl/x-heep#244) (Davide Schiavone)
* add PDM2PCM peripheral (esl-epfl/x-heep#192) (grinningmosfet)
* Peripherals struct multireg and address mismatch fix (esl-
  epfl/x-heep#234) (Stefano Albini)
* fix for VCS (esl-epfl/x-heep#229) (Cyril)
* Build external sources with external drivers (esl-epfl/x-heep#227)
  (JuanSapriza)
* add verilator run app command (esl-epfl/x-heep#228) (Tim Frey)
* add tc_clk_xor2 (esl-epfl/x-heep#225) (Tim Frey)
* fix venv / conda envs (esl-epfl/x-heep#221) (Davide Schiavone)
* update common cells (esl-epfl/x-heep#223) (Davide Schiavone)

Signed-off-by: Juan Sapriza <juan.sapriza@epfl.ch>
JuanSapriza added a commit to JuanSapriza/HEEPsilon that referenced this pull request Oct 24, 2023
Update code from upstream repository https://github.com/esl-
epfl/x-heep.git to revision df569a88fc7eaa447645262f0d3a76dd22c519f7

* enable mcycle in matadd examples (esl-epfl/x-heep#413) (Davide
  Schiavone)
* reduce FPGA frequencz to 15MHz to accomodate FPU (esl-
  epfl/x-heep#404) (Davide Schiavone)
* fix cv32e4  verilator waivers (esl-epfl/x-heep#402) (Davide
  Schiavone)
* fix GPIO HAL by adding selection of GPIO domain (esl-
  epfl/x-heep#385) (Davide Schiavone)
* update vendor fpu_ss (esl-epfl/x-heep#397) (Davide Schiavone)
* fix cv32e40px fpga (esl-epfl/x-heep#396) (Davide Schiavone)
* add fpu over cv-x-if in tb (esl-epfl/x-heep#392) (Davide Schiavone)
* SEGGER Embedded Studio support for X-HEEP (esl-epfl/x-heep#370)
  (jmiranda)
* Squashed commit of the following: (jmiranda)
* Always use `MCU_CFG` variable in `Makefile` (esl-epfl/x-heep#391)
  (Michele Caon)
* update cv32e40p (esl-epfl/x-heep#389) (Davide Schiavone)
* update cv32e40px (esl-epfl/x-heep#388) (Davide Schiavone)
* use jtag i/o from harness when not using jtag dpi (esl-
  epfl/x-heep#379) (Davide Schiavone)
* Fix esl-epfl/x-heep#336 (esl-epfl/x-heep#364) (JuanSapriza)
* add minimal configuration for mcu-gen (esl-epfl/x-heep#378) (Davide
  Schiavone)
* PLIC handlers array (esl-epfl/x-heep#363) (JuanSapriza)
* Update README.md (jmiranda)
* Choose linker compiler and sim/nosim in test_all.sh (esl-
  epfl/x-heep#359) (JuanSapriza)
* Modified the two target header files so that they add a define with
  a value. That is then used to modify the PRINTF logic in all apps
  (esl-epfl/x-heep#361) (JuanSapriza)
* add obi fifo stage to/from peripherals (esl-epfl/x-heep#200) (Davide
  Schiavone)
* added support for clock-gating external subsystems (esl-
  epfl/x-heep#354) (Simone Machetti)
* Improved the comments on the eXtendingHEEP readme (esl-
  epfl/x-heep#360) (JuanSapriza)
* Modified the way of realizing if an app is external or not
  (JuanSapriza)
* add script to simulate all apps (esl-epfl/x-heep#341) (JuanSapriza)
* [app] fix APPs on flash_exec (esl-epfl/x-heep#357) (Davide
  Schiavone)
* adding attributes and mux pad parameters in mcu-gen (esl-
  epfl/x-heep#349) (Davide Schiavone)
* change signal names in power manager to reflex polarity (esl-
  epfl/x-heep#352) (Simone Machetti)
* fix power gating core app (esl-epfl/x-heep#355) (Davide Schiavone)
* add cv32e40px (esl-epfl/x-heep#353) (Davide Schiavone)
* moved fpnew in its own directory (esl-epfl/x-heep#351) (Davide
  Schiavone)
* update cv32e40p divider (esl-epfl/x-heep#350) (Davide Schiavone)
* fix external pad gen (esl-epfl/x-heep#346) (Davide Schiavone)
* fix mcu-gen (esl-epfl/x-heep#345) (Davide Schiavone)
* update GPIO driver (esl-epfl/x-heep#246) (Hossein Taji)
* fix interleaved bus (esl-epfl/x-heep#340) (Daniel Vázquez)
* fix esl-epfl/x-heep#338 (esl-epfl/x-heep#339) (Davide Schiavone)
* Initialized variables to 0 inside functions. Removed printf comments
  (esl-epfl/x-heep#334) (JuanSapriza)
* made the dma_is_ready() function non-optimizable at all. (esl-
  epfl/x-heep#333) (JuanSapriza)
* fix SPI apps (esl-epfl/x-heep#327) (Davide Schiavone)
* Include x-heep.h to all apps that need it (esl-epfl/x-heep#329)
  (JuanSapriza)
* Added soc_ctrl-reg_top warning to waiver (esl-epfl/x-heep#326)
  (JuanSapriza)
* fix several applications (esl-epfl/x-heep#325) (Davide Schiavone)
* Tries to use cmake3. If that is not available, go ahead with cmake
  (esl-epfl/x-heep#323) (JuanSapriza)
* Improve the timing of cv32e40x by removing the debug triggers (esl-
  epfl/x-heep#324) (David Mallasén Quintana)
* refactoring of examples (esl-epfl/x-heep#322) (JuanSapriza)
* expose internal master ports to external devices (esl-
  epfl/x-heep#268) (Michele Caon)

Signed-off-by: Juan Sapriza <juan.sapriza@epfl.ch>
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