Basic nmigen generator bench for TAP top cell.
[c4m-jtag.git] / test / nmigen / gen / controller / generate.py
1 #!/bin/env python3
2 from nmigen import *
3 from nmigen.back.verilog import convert
4 from nmigen.build import Platform
5
6 from c4m.nmigen.jtag import TAP
7
8 class DummyPlatform(Platform):
9 resources = []
10 connectors = []
11 required_tools = ["yosys"]
12
13 def toolchain_prepare(self, fragment, name, **kwargs):
14 raise NotImplementedError
15
16 tap = TAP(2)
17 f = open("top.v", "w")
18 f.write(convert(tap, platform=DummyPlatform()))
19 f.close()
20