-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
107 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ build/ | |
firmware/deps/generated-litex-pac/src/* | ||
.aider* | ||
*.fbi | ||
*.vcd | ||
*.sv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,3 +76,9 @@ | |
[submodule "firmware/deps/ssd1322"] | ||
path = firmware/deps/ssd1322 | ||
url = [email protected]:schnommus/ssd1322.git | ||
[submodule "deps/litescope"] | ||
path = deps/litescope | ||
url = https://github.com/enjoy-digital/litescope | ||
[submodule "deps/pythondata-misc-tapcfg"] | ||
path = deps/pythondata-misc-tapcfg | ||
url = https://github.com/litex-hub/pythondata-misc-tapcfg.git |
Submodule litex
updated
5 files
+1 −1 | litex/build/sim/core/modules/Makefile | |
+2 −0 | litex/build/sim/core/modules/i2s/Makefile | |
+140 −0 | litex/build/sim/core/modules/i2s/i2s.c | |
+25 −2 | litex/soc/cores/dma.py | |
+8 −5 | litex/tools/litex_sim.py |
Submodule pythondata-misc-tapcfg
added at
fbcb02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import lxbuildenv | ||
|
||
from litex.tools.litex_sim import main | ||
|
||
from litex.build.generic_platform import * | ||
from litex.soc.cores.clock import * | ||
from litex.soc.cores.dma import * | ||
from litex.soc.interconnect import wishbone | ||
from litex.soc.interconnect.stream import ClockDomainCrossing | ||
from litex.soc.interconnect.csr_eventmanager import * | ||
|
||
from rtl.eurorack_pmod_wrapper import EurorackPmod | ||
from rtl.dsp import create_voices | ||
|
||
CLK_FREQ_SYS = 5e6 | ||
CLK_FREQ_256FS = 1e6 | ||
CLK_FREQ_FS = CLK_FREQ_256FS / 256 | ||
|
||
_io_extra_clockers = [ | ||
("clocker_256fs", 0, Pins(1)), | ||
] | ||
|
||
_io_eurorack_pmod = [ | ||
("eurorack_pmod_clk0", 0, | ||
Subsignal("mclk", Pins(1)), | ||
Subsignal("bick", Pins(1)), | ||
Subsignal("lrck", Pins(1)), | ||
Subsignal("pdn", Pins(1)), | ||
IOStandard("LVCMOS33") | ||
), | ||
("eurorack_pmod0", 0, | ||
Subsignal("i2c_sda", Pins(1)), | ||
Subsignal("i2c_scl", Pins(1)), | ||
Subsignal("sdin1", Pins(1)), | ||
Subsignal("sdout1", Pins(1)), | ||
), | ||
] | ||
def sim_soc_extension(sim_config, soc): | ||
|
||
# Add 256Fs PLL simulation | ||
soc.platform.add_extension(_io_extra_clockers) | ||
sim_config.add_clocker("clocker_256fs", freq_hz=int(CLK_FREQ_256FS)) | ||
soc.cd_clk_256fs = ClockDomain() | ||
soc.comb += [ | ||
soc.cd_clk_256fs.clk.eq(soc.platform.request("clocker_256fs")), | ||
] | ||
|
||
# Create 1*Fs clock domain using a division register | ||
soc.cd_clk_fs = ClockDomain() | ||
clkdiv_fs = Signal(8) | ||
soc.sync.clk_256fs += clkdiv_fs.eq(clkdiv_fs+1) | ||
soc.comb += soc.cd_clk_fs.clk.eq(clkdiv_fs[-1]) | ||
|
||
# Instantiate EurorackPmod | ||
soc.platform.add_extension(_io_eurorack_pmod) | ||
shared_pads = soc.platform.request("eurorack_pmod_clk0") | ||
pmod0_pads = soc.platform.request("eurorack_pmod0") | ||
pmod0 = EurorackPmod(soc.platform, pmod0_pads, drive_shared_pads=shared_pads, sim=True) | ||
soc.add_module("eurorack_pmod0", pmod0) | ||
|
||
N_VOICES=4 | ||
create_voices(soc, pmod0, N_VOICES) | ||
|
||
sim_config.add_module("i2s", ["eurorack_pmod0", "eurorack_pmod_clk0"]) | ||
|
||
if __name__ == "__main__": | ||
main(sys_clk_freq=CLK_FREQ_SYS, soc_extension_hook=sim_soc_extension) |