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

vADC example #10

Closed
wants to merge 85 commits into from
Closed

vADC example #10

wants to merge 85 commits into from

Conversation

JuanSapriza
Copy link

@JuanSapriza JuanSapriza commented Mar 7, 2024

Introduction

This is a full example of the virtual ADC + integration with the ADC-emu.

The changes are as follow:

vADC example

It is a Jupyter notebook under sw/arm/jupyter_notebooks/vadc_example. It takes a txt file containing multimodal signals and feeds them to an ADC-emu (currently kept as a submodule on my github. This ADC-emu generates a Timeseries signal that can be easily converted to a binary file to be used by the vADC hardware.

It requires the vADC hardware. You need to Load the bitstreams in hw/x_heep_vadc.bit/hwh (done automatically) and also change the performance counters offset to PERFORMANCE_COUNTERS_OFFSET = 0x44A10000 (currently commented on the code)

ADC-emu

The ADC-emu is a submodule cloned into the arm sdk. It takes Timeseries variables and modifies them to emulate the output of an ADC (e.g. quantizes, re-samples, adds noise, etc).

Modularization of the SDK

To allow the use of SDK functions without previously calling the x_heep class (loading the bitstream) I separated the different peripherals into modules. This will also allow us to maintain them more easily.

Removal of python scripts

Because we had everything doubled: jupyter notebook + python script, i removed the python scripts. I modified the verification script (now in sw/arm/jupyter_notebooks/verification.py to run all the notebooks that are in that same folder. This does not include the vadc_example that is in its own folder.

Reset of the PL

Before changing a bitstream for another you need to reset the PL in order to clear the cache regarding the configuration file (hwh). This was integrated into the x_heep.init() function.


Testing

  • I have tested the vADC application with the changes explained above.
  • I have tested all the notebook manually and all succeed
  • I have tested the verification.py script and all succeed

Please perform your own tests (these and others you can think of)


Future work

For the SDK @simone-machetti @denizkasap

The previous point will require to extract the offsets from the .hwh file. This seems to be easy and could generate an offsets.py file upon loading the bitstream.

For the vADC

We need to be able to modify the frequencies involved. Now everything is kind of hardcoded or ignored.


THIS PR SHOULD NOT BE MERGED UNTIL THE HW IS MERGED
The vADC hardware must be merged into the latest hardware integrating the new bridges @ruben-roalvarez

JuanSapriza and others added 30 commits November 21, 2023 20:29
…n value in a nice way. virtual adc read as an example
@JuanSapriza JuanSapriza deleted the vadc_example branch March 17, 2024 10:16
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