class Constraints:
- def __init__(self, in_clk, in_rst_n, spi2csr0, led0):
+ def __init__(self, in_clk, in_rst_n, spi2csr0, led0, sw0):
self.constraints = []
def add(signal, pin, vec=-1, iostandard="3.3-V LVTTL", extra="", sch=""):
self.constraints.append((signal, vec, pin, iostandard, extra,sch))
# led0
add_vec(led0, ["U22", "U21", "V22", "V21",
"W22" , "W21" , "Y22" , "Y21"])
+ # sw0
+ add_vec(sw0, ["L22", "L21", "M22", "V12",
+ "W12" , "U12" , "U11" , "M2"])
def get_ios(self):
return set([c[0] for c in self.constraints])
import sys
sys.path.append("../../")
-from migScope import trigger, recorder
+from migScope import trigger, recorder, migIo
import spi2Csr
from timings import *
#==============================================================================
def get():
- # Control Reg
- control_reg0 = RegisterField("control_reg0", 32, reset=0, access_dev=READ_ONLY)
- regs = [control_reg0]
- bank0 = csrgen.Bank(regs,address=CONTROL_ADDR)
+ # migIo
+ migIo0 = migIo.MigIo(8,"IO")
# Trigger
term0 = trigger.Term(trig_width)
# Csr Interconnect
csrcon0 = csr.Interconnect(spi2csr0.csr,
[
- bank0.interface,
+ migIo0.bank.interface,
trigger0.bank.interface,
recorder0.bank.interface
])
# Led
led0 = Signal(BV(8))
- comb += [
- led0.eq(control_reg0.field.r[:8])
- ]
-
+ comb += [led0.eq(migIo0.o)]
+
+ #Switch
+ sw0 = Signal(BV(8))
+ comb += [migIo0.i.eq(sw0)]
# Dat / Trig Bus
]
frag = autofragment.from_local()
frag += Fragment(sync=sync,comb=comb)
- cst = Constraints(in_clk, in_rst_n, spi2csr0, led0)
+ cst = Constraints(in_clk, in_rst_n, spi2csr0, led0, sw0)
src_verilog, vns = verilog.convert(frag,
cst.get_ios(),
name="de1",