仿真平台内核初版 -tlib库 包含<sparc arm riscv powerPC>
This commit is contained in:
24
scripts/complex/litex_i2s/README.rst
Normal file
24
scripts/complex/litex_i2s/README.rst
Normal file
@@ -0,0 +1,24 @@
|
||||
Description
|
||||
-----------
|
||||
|
||||
This is a demo showcasing the sound-handling capabilities of Renode on the example of a Zephyr application running on LiteX with the I2S module.
|
||||
|
||||
The application copies the stereo signal encoded in 24-bit PCM format (signed, little-endian) at the 44100Hz rate from the input to the output.
|
||||
|
||||
By default, the demo runs the simulation for 3.2 virtual seconds in order to copy a 3s sample containing a 440Hz sine signal with periodical beeps.
|
||||
The user can change these settings by providing the following variables:
|
||||
* $zephyr_application - an ELF file with the application to run on the CPU,
|
||||
* $simulation_duration - a period (in virtual seconds) for the simulation to run,
|
||||
* $input_file - an input sound sample (in the format described above).
|
||||
|
||||
How to run
|
||||
----------
|
||||
|
||||
The demo requires an `output_file` that points to the file containing the sound data generated by the Zephyr application.
|
||||
|
||||
Run the following lines in the Monitor in order to run the demo:
|
||||
|
||||
(monitor) $output_file=@/tmp/output.pcm
|
||||
(monitor) include @scripts/complex/litex_i2s/litex_vexriscv_i2s.resc
|
||||
|
||||
Note: There is no need to start the simulation after including the script - it will run the simulation for 3.2 virtual seconds automatically.
|
||||
28
scripts/complex/litex_i2s/litex_vexriscv_i2s.resc
Normal file
28
scripts/complex/litex_i2s/litex_vexriscv_i2s.resc
Normal file
@@ -0,0 +1,28 @@
|
||||
# NOTE: set the `$output_file` variable before including this script
|
||||
|
||||
$zephyr_application=@https://dl.antmicro.com/projects/renode/litex_i2s--zephyr-echo_sample.elf-s_1172756-db2f7eb8c6c8f396651b2f2d517cee13d79a9a69
|
||||
$simulation_duration?="3.2"
|
||||
$input_file?=@https://dl.antmicro.com/projects/renode/sine440_with_beep_aligned.pcm_s24le_44100_stereo.raw-s_793344-b37432aad6a22f36cb5c1e239c9bce4adbcd15fb
|
||||
|
||||
using sysbus
|
||||
|
||||
mach create
|
||||
machine LoadPlatformDescription @platforms/cpus/litex_zephyr_vexriscv_i2s.repl
|
||||
|
||||
showAnalyzer sysbus.uart
|
||||
|
||||
macro reset
|
||||
"""
|
||||
sysbus LoadELF $zephyr_application
|
||||
|
||||
i2s_tx Output $output_file
|
||||
i2s_rx LoadPCM $input_file
|
||||
|
||||
emulation RunFor $simulation_duration
|
||||
|
||||
echo "The output file:"
|
||||
echo $output_file
|
||||
echo "The emulation is now paused"
|
||||
"""
|
||||
|
||||
runMacro $reset
|
||||
Reference in New Issue
Block a user