Skip to content

Commit 15fa563

Browse files
committed
wip
1 parent 983b0e6 commit 15fa563

File tree

3 files changed

+72
-42
lines changed

3 files changed

+72
-42
lines changed

tests/fixtures/chipflow-flexic.toml

Lines changed: 0 additions & 42 deletions
This file was deleted.

tests/fixtures/mock.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[chipflow]
2+
project_name = "proj-name"
3+
4+
[chipflow.steps]
5+
silicon = "chipflow_lib.steps.silicon:SiliconStep"
6+
7+
[chipflow.silicon]
8+
process = "test"
9+
pad_ring = "cf20"
10+
11+
[chipflow.clocks]
12+
default = 'sys_clk'
13+
14+
[chipflow.resets]
15+
default = 'sys_rst_n'
16+
17+
[chipflow.silicon.pads]
18+
sys_clk = { type = "clk", loc = "N3" }
19+
sys_rst_n = { type = "i", loc = "N4" }
20+
21+
[chipflow.silicon.power]
22+
vss = { loc = "N1" }
23+
vssio = { loc = "N5" }
24+
vddio = { loc = "N6" }
25+
vdd = { loc = "N7" }

tests/fixtures/mock_top.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SPDX-License-Identifier: BSD-2-Clause
2+
from amaranth import Module
3+
from amaranth.lib import wiring
4+
from amaranth.lib.wiring import In, Out, flipped, connect
5+
6+
from chipflow_lib.platforms import InputPinSignature, OutputPinSignature, BidirPinSignature
7+
8+
__all__ = ["MockTop"]
9+
10+
TestSignature1 = wiring.Signature({
11+
"a": In(InputPinSignature(1)),
12+
"b": In(InputPinSignature(5)),
13+
"c": Out(OutputPinSignature(1)),
14+
"d": Out(OutputPinSignature(10)),
15+
"e": In(BidirPinSignature(1)),
16+
"f": In(BidirPinSignature(7)),
17+
})
18+
19+
TestSignature2 = wiring.Signature({
20+
"a": Out(OutputPinSignature(1)),
21+
"b": Out(OutputPinSignature(5)),
22+
"c": In(InputPinSignature(1)),
23+
"d": In(InputPinSignature(10)),
24+
"e": Out(BidirPinSignature(1)),
25+
"f": Out(BidirPinSignature(7)),
26+
})
27+
28+
29+
# ---------
30+
31+
class MockTop(wiring.Component):
32+
def __init__(self):
33+
# Top level interfaces
34+
35+
interfaces = {
36+
"test1" : Out(TestSignature1),
37+
"test2": Out(TestSignature2)
38+
}
39+
40+
super().__init__(interfaces)
41+
42+
def elaborate(self, platform):
43+
m = Module()
44+
for inpin, outpin in zip(self.test1.members, self.test2.members):
45+
m.d.comb += inpin.eq(outpin)
46+
47+
return m

0 commit comments

Comments
 (0)