Add propegation test and results waveform

This commit is contained in:
Aadi Desai 2023-06-05 18:28:22 +01:00
parent b9ea99a601
commit 964d0b0c5e
No known key found for this signature in database
3 changed files with 25448 additions and 20 deletions

46
make.py
View file

@ -251,30 +251,36 @@ class BaseSoC(SoCCore):
# pads = platform.request("dac_ctrl")
# )
# Propagation Delay Test -------------------------------------------------------------------
from testProp import TestProp
self.proptest = TestProp(platform = platform)
# LiteScope Analyzer -----------------------------------------------------------------------
self.add_uartbone(name="debug_uart", baudrate=921600)
from litescope import LiteScopeAnalyzer
analyzer_signals = [
self.can.can_rx,
self.can.can_tx,
# self.dac_vol.volume.re,
# self.dac_vol.volume.storage,
# self.dac_vol.m_sel_n,
# self.dac_vol.m_clock,
# self.dac_vol.m_data,
self.audio.targ0.re,
# self.audio.targ0.storage,
self.audio.wave0.re,
# self.audio.wave0.storage,
self.audio.backpressure_48,
# self.audio.sample_48,
self.audio.audioready_48,
self.audio.readrequest_36,
# self.audio.sample_36,
self.audio.fifoempty_36,
self.audio.dac_lrck,
self.audio.dac_bck,
self.audio.dac_data,
self.proptest.i_saw,
self.proptest.o_sin,
# self.can.can_rx,
# self.can.can_tx,
# # self.dac_vol.volume.re,
# # self.dac_vol.volume.storage,
# # self.dac_vol.m_sel_n,
# # self.dac_vol.m_clock,
# # self.dac_vol.m_data,
# self.audio.targ0.re,
# # self.audio.targ0.storage,
# self.audio.wave0.re,
# # self.audio.wave0.storage,
# self.audio.backpressure_48,
# # self.audio.sample_48,
# self.audio.audioready_48,
# self.audio.readrequest_36,
# # self.audio.sample_36,
# self.audio.fifoempty_36,
# self.audio.dac_lrck,
# self.audio.dac_bck,
# self.audio.dac_data,
]
from math import ceil, floor
analyzer_depth = floor(190_000 / ((ceil(sum([s.nbits for s in analyzer_signals]) / 16)) * 16))

34
testProp.py Normal file
View file

@ -0,0 +1,34 @@
from migen import *
from litex.soc.interconnect.csr import *
from litex.soc.integration.doc import ModuleDoc
# Test RGB Module ----------------------------------------------------------------------------------
class TestProp(Module, AutoCSR, ModuleDoc):
"""
Propagation Test Module
Test propagation delay of the genSaw block
"""
def __init__(self, platform):
platform.add_source("rtl/cordic.sv")
platform.add_source("rtl/saw2sin.sv")
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.delay = Signal(3) # Update i_saw after 2^3 = 8 cycles
self.i_saw = Signal(16)
self.o_sin = Signal(16)
# # #
self.sync += self.delay.eq(self.delay + 1)
self.sync += If(self.delay == 0, self.i_saw.eq(self.i_saw + 1))
self.specials += Instance("saw2sin",
i_i_clk = ClockSignal(),
i_i_saw = self.i_saw,
o_o_sin = self.o_sin,
)

25388
testPropTiming.vcd Normal file

File diff suppressed because it is too large Load diff