mirror of
https://github.com/supleed2/EIE4-FYP.git
synced 2024-12-22 14:15:50 +00:00
Update note.cpp and main.cpp for new CSRStorage layout
This commit is contained in:
parent
b2573b5f95
commit
afcf1093be
|
@ -124,7 +124,7 @@ static void leds_cmd(char **val) {
|
|||
static void saw_cmd(char **val) {
|
||||
int value = (int)strtol(get_token(val), NULL, 0);
|
||||
printf("Setting Sawtooth to %dHz\n", value);
|
||||
audio_targ_write(value);
|
||||
audio_targ0_write(value);
|
||||
}
|
||||
|
||||
static void imperial_cmd() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <stdint.h>
|
||||
|
||||
void note(uint32_t frequency, unsigned int duration_ms) {
|
||||
audio_targ_write(frequency);
|
||||
audio_targ0_write(frequency);
|
||||
busy_wait(duration_ms);
|
||||
audio_targ_write(0);
|
||||
audio_targ0_write(0);
|
||||
}
|
||||
|
|
4
make.py
4
make.py
|
@ -241,8 +241,8 @@ class BaseSoC(SoCCore):
|
|||
self.add_uartbone(name="debug_uart", baudrate=921600)
|
||||
from litescope import LiteScopeAnalyzer
|
||||
analyzer_signals = [
|
||||
self.audio.targ.re,
|
||||
self.audio.targ.storage,
|
||||
self.audio.targ0.re,
|
||||
self.audio.targ0.storage,
|
||||
# self.audio.backpressure_48,
|
||||
# self.audio.sample_48,
|
||||
# self.audio.audioready_48,
|
||||
|
|
23
testSaw.py
23
testSaw.py
|
@ -18,7 +18,26 @@ class TestSaw(Module, AutoCSR, ModuleDoc):
|
|||
platform.add_source("rtl/dacDriver.sv")
|
||||
|
||||
self.pads = pads
|
||||
self.targ = CSRStorage(size = 24, description="Target Frequency of the Sawtooth Wave")
|
||||
self.targ0 = CSRStorage(size = 24, description = "Oscillator 0: Target Frequency of the Sawtooth Wave")
|
||||
self.wave0 = CSRStorage(size = 8, description = "Oscillator 0: Waveform to Output")
|
||||
self.targ1 = CSRStorage(size = 24, description = "Oscillator 1: Target Frequency of the Sawtooth Wave")
|
||||
self.wave1 = CSRStorage(size = 8, description = "Oscillator 1: Waveform to Output")
|
||||
self.targ2 = CSRStorage(size = 24, description = "Oscillator 2: Target Frequency of the Sawtooth Wave")
|
||||
self.wave2 = CSRStorage(size = 8, description = "Oscillator 2: Waveform to Output")
|
||||
self.targ3 = CSRStorage(size = 24, description = "Oscillator 3: Target Frequency of the Sawtooth Wave")
|
||||
self.wave3 = CSRStorage(size = 8, description = "Oscillator 3: Waveform to Output")
|
||||
self.targ4 = CSRStorage(size = 24, description = "Oscillator 4: Target Frequency of the Sawtooth Wave")
|
||||
self.wave4 = CSRStorage(size = 8, description = "Oscillator 4: Waveform to Output")
|
||||
self.targ5 = CSRStorage(size = 24, description = "Oscillator 5: Target Frequency of the Sawtooth Wave")
|
||||
self.wave5 = CSRStorage(size = 8, description = "Oscillator 5: Waveform to Output")
|
||||
self.targ6 = CSRStorage(size = 24, description = "Oscillator 6: Target Frequency of the Sawtooth Wave")
|
||||
self.wave6 = CSRStorage(size = 8, description = "Oscillator 6: Waveform to Output")
|
||||
self.targ7 = CSRStorage(size = 24, description = "Oscillator 7: Target Frequency of the Sawtooth Wave")
|
||||
self.wave7 = CSRStorage(size = 8, description = "Oscillator 7: Waveform to Output")
|
||||
self.targ8 = CSRStorage(size = 24, description = "Oscillator 8: Target Frequency of the Sawtooth Wave")
|
||||
self.wave8 = CSRStorage(size = 8, description = "Oscillator 8: Waveform to Output")
|
||||
self.targ9 = CSRStorage(size = 24, description = "Oscillator 9: Target Frequency of the Sawtooth Wave")
|
||||
self.wave9 = CSRStorage(size = 8, description = "Oscillator 9: Waveform to Output")
|
||||
|
||||
# 48MHz Domain Signals
|
||||
self.backpressure_48 = Signal()
|
||||
|
@ -39,7 +58,7 @@ class TestSaw(Module, AutoCSR, ModuleDoc):
|
|||
i_i_clk48 = ClockSignal(),
|
||||
i_i_rst48_n = ~ResetSignal(),
|
||||
i_i_pause = self.backpressure_48,
|
||||
i_i_targetf = self.targ.storage,
|
||||
i_i_targetf = self.targ0.storage,
|
||||
o_o_sample = self.sample_48,
|
||||
o_o_pulse = self.audioready_48,
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue