|
1 |
| -export default { |
2 |
| - amaranthVersions: ['v0.4.5', 'v0.4.4', 'v0.4.3', 'v0.4.2'], |
3 |
| - pythonPackages: { |
4 |
| - 'v0.4.5': [ |
5 |
| - 'https://files.pythonhosted.org/packages/98/8d/a0d8fb2b9611f3ae22ddc98890b346833fa2c645ad21fd282e61ccdad477/pyvcd-0.4.0-py2.py3-none-any.whl', |
6 |
| - 'https://files.pythonhosted.org/packages/1a/bf/cff5c705f2f5978889e1fa0fc2a70e0fadbb9f2a51db2d3315c3bda7c3ea/amaranth-0.4.5-py3-none-any.whl', |
7 |
| - ], |
8 |
| - 'v0.4.4': [ |
9 |
| - 'https://files.pythonhosted.org/packages/98/8d/a0d8fb2b9611f3ae22ddc98890b346833fa2c645ad21fd282e61ccdad477/pyvcd-0.4.0-py2.py3-none-any.whl', |
10 |
| - 'https://files.pythonhosted.org/packages/ee/66/bbb766873059d8051ddb7e760de80beefd286979bc9a786e7ec4ac524336/amaranth-0.4.4-py3-none-any.whl', |
11 |
| - ], |
12 |
| - 'v0.4.3': [ |
13 |
| - 'https://files.pythonhosted.org/packages/98/8d/a0d8fb2b9611f3ae22ddc98890b346833fa2c645ad21fd282e61ccdad477/pyvcd-0.4.0-py2.py3-none-any.whl', |
14 |
| - 'https://files.pythonhosted.org/packages/72/34/82f76a59f4155e26f42cf9f9d04d80befe774aa8af6d9b6e48d3e7b9f060/amaranth-0.4.3-py3-none-any.whl', |
15 |
| - ], |
16 |
| - 'v0.4.2': [ |
17 |
| - 'https://files.pythonhosted.org/packages/98/8d/a0d8fb2b9611f3ae22ddc98890b346833fa2c645ad21fd282e61ccdad477/pyvcd-0.4.0-py2.py3-none-any.whl', |
18 |
| - 'https://files.pythonhosted.org/packages/27/1c/39881fbd48f9de91d64955f206a7f32fd912d306d18e8c5f74126ee5962f/amaranth-0.4.2-py3-none-any.whl', |
19 |
| - ], |
20 |
| - }, |
21 |
| - demoCode: `\ |
| 1 | +const rfc3986_2_0_0 = 'https://files.pythonhosted.org/packages/ff/9a/9afaade874b2fa6c752c36f1548f718b5b83af81ed9b76628329dab81c1b/rfc3986-2.0.0-py2.py3-none-any.whl'; |
| 2 | +const jschon_0_11_1 = 'https://files.pythonhosted.org/packages/ce/b1/31f454a2ac0d23b0a47283d115f0af4abe2a1ea391f5ccb223e02d685b82/jschon-0.11.1-py3-none-any.whl'; |
| 3 | +const pyvcd_0_4_0 = 'https://files.pythonhosted.org/packages/98/8d/a0d8fb2b9611f3ae22ddc98890b346833fa2c645ad21fd282e61ccdad477/pyvcd-0.4.0-py2.py3-none-any.whl'; |
| 4 | +const amaranth_0_4_2 = 'https://files.pythonhosted.org/packages/27/1c/39881fbd48f9de91d64955f206a7f32fd912d306d18e8c5f74126ee5962f/amaranth-0.4.2-py3-none-any.whl'; |
| 5 | +const amaranth_0_4_3 = 'https://files.pythonhosted.org/packages/72/34/82f76a59f4155e26f42cf9f9d04d80befe774aa8af6d9b6e48d3e7b9f060/amaranth-0.4.3-py3-none-any.whl'; |
| 6 | +const amaranth_0_4_4 = 'https://files.pythonhosted.org/packages/ee/66/bbb766873059d8051ddb7e760de80beefd286979bc9a786e7ec4ac524336/amaranth-0.4.4-py3-none-any.whl'; |
| 7 | +const amaranth_0_4_5 = 'https://files.pythonhosted.org/packages/1a/bf/cff5c705f2f5978889e1fa0fc2a70e0fadbb9f2a51db2d3315c3bda7c3ea/amaranth-0.4.5-py3-none-any.whl'; |
| 8 | +const amaranth_0_5_0 = 'https://files.pythonhosted.org/packages/d3/34/8a21cc1765f1952eb35766cf76ec8a1b3e73f32ae78d9bf1c1a88313bdcd/amaranth-0.5.0-py3-none-any.whl'; |
| 9 | +const pythonPackages = { |
| 10 | + 'v0.5.0': [rfc3986_2_0_0, jschon_0_11_1, pyvcd_0_4_0, amaranth_0_5_0], |
| 11 | + 'v0.4.5': [pyvcd_0_4_0, amaranth_0_4_5], |
| 12 | + 'v0.4.4': [pyvcd_0_4_0, amaranth_0_4_4], |
| 13 | + 'v0.4.3': [pyvcd_0_4_0, amaranth_0_4_3], |
| 14 | + 'v0.4.2': [pyvcd_0_4_0, amaranth_0_4_2], |
| 15 | +}; |
| 16 | + |
| 17 | +const demoCode_0_4 = `\ |
22 | 18 | from amaranth import *
|
23 | 19 | from amaranth.sim import Simulator, Tick
|
24 | 20 | from amaranth.back import rtlil, verilog
|
@@ -46,5 +42,46 @@ with amaranth_playground.show_waveforms(sim):
|
46 | 42 |
|
47 | 43 | amaranth_playground.show_verilog(verilog.convert(m, ports=[count]))
|
48 | 44 | # amaranth_playground.show_rtlil(rtlil.convert(m, ports=[count]))
|
49 |
| -`, |
| 45 | +`; |
| 46 | +const demoCode_0_5 = `\ |
| 47 | +from amaranth import * |
| 48 | +from amaranth.sim import Simulator |
| 49 | +from amaranth.back import rtlil, verilog |
| 50 | +import amaranth_playground |
| 51 | +
|
| 52 | +
|
| 53 | +en = Signal() |
| 54 | +count = Signal(4) |
| 55 | +m = Module() |
| 56 | +with m.If(en): |
| 57 | + m.d.sync += count.eq(count + 1) |
| 58 | +m.d.comb += en.eq(count < 5) |
| 59 | +
|
| 60 | +
|
| 61 | +async def testbench(ctx): |
| 62 | + for _ in range(10): |
| 63 | + await ctx.tick() |
| 64 | + print(f"count: {ctx.get(count)}") |
| 65 | +
|
| 66 | +sim = Simulator(m) |
| 67 | +sim.add_clock(1e-6) |
| 68 | +sim.add_testbench(testbench) |
| 69 | +with amaranth_playground.show_waveforms(sim): |
| 70 | + sim.run() |
| 71 | +
|
| 72 | +amaranth_playground.show_verilog(verilog.convert(m, ports=[count])) |
| 73 | +# amaranth_playground.show_rtlil(rtlil.convert(m, ports=[count])) |
| 74 | +`; |
| 75 | +const demoCode = { |
| 76 | + 'v0.5.0': demoCode_0_5, |
| 77 | + 'v0.4.5': demoCode_0_4, |
| 78 | + 'v0.4.4': demoCode_0_4, |
| 79 | + 'v0.4.3': demoCode_0_4, |
| 80 | + 'v0.4.2': demoCode_0_4, |
| 81 | +}; |
| 82 | + |
| 83 | +export default { |
| 84 | + amaranthVersions: Array.from(Object.keys(pythonPackages)), |
| 85 | + pythonPackages, |
| 86 | + demoCode, |
50 | 87 | };
|
0 commit comments