Skip to content

Commit

Permalink
urukul/v1.1 changes: fsen, variant, ifc_mode[3]
Browse files Browse the repository at this point in the history
* use ifc_mode[0] | variant (v1.1) and ifc_mode[0] | ifc_mode[3] (v1.0)
  respectively to drive en_9910 (compatible)
* drive fsen (failsafe) high, unconnected on v1.0
  • Loading branch information
jordens committed Feb 27, 2018
1 parent 23e3d05 commit 2d1c145
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
20 changes: 14 additions & 6 deletions urukul.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ def __init__(self, platform, n=4):
dds_sync = platform.lookup_request("dds_sync")
att = platform.lookup_request("att")
clk = platform.lookup_request("clk")
ifc_mode = platform.lookup_request("ifc_mode")
en_9910 = ifc_mode[0]
self.en_9910 = Signal()

self.comb += [
dds_common.profile.eq(self.data.profile),
Expand All @@ -127,7 +126,7 @@ def __init__(self, platform, n=4):
sw.oe.eq(0),
dds.rf_sw.eq(sw.io | self.data.rf_sw[i]),
dds.led[0].eq(dds.rf_sw), # green
dds.led[1].eq(self.data.led[i] | (en_9910 & (
dds.led[1].eq(self.data.led[i] | (self.en_9910 & (
dds.smp_err | ~dds.pll_lock))), # red
]

Expand Down Expand Up @@ -225,10 +224,13 @@ class Urukul(Module):
| IFC_MODE | Name | Function |
|----------+---------+-------------------------------------------------|
| 0 | EN_9910 | On if AD9910 is populated |
| 0 | EN_9910 | On if AD9910 is populated (OR VARIANT) |
| 1 | EN_NU | On if NU-Servo mode is used |
| 2 | EN_EEM1 | On if the SYNC signals on EEM1 should be driven |
| 3 | UNUSED | Unused switch |
| 3 | UNUSED | Unusable on Urukul/v1.0 |
On Urukul/v1.0, IFC_MODE[0] | IFC_MODE[3] drive EN_9910.
On Urukul/v1.1, IFC_MODE[0] | VARIANT (board population) drive EN_9910.
See :class:`Urukul`
Expand Down Expand Up @@ -366,7 +368,9 @@ def __init__(self, platform):
dds_sync = platform.request("dds_sync")
dds_common = platform.request("dds_common")
ifc_mode = platform.request("ifc_mode")
variant = platform.request("variant")
att = platform.request("att")
fsen = platform.request("fsen")
dds = [platform.request("dds", i) for i in range(4)]

ts_clk_div = TSTriple()
Expand Down Expand Up @@ -398,9 +402,12 @@ def __init__(self, platform):
en_9910 = Signal() # AD9910 populated (instead of AD9912)
en_nu = Signal() # NU-Servo operation with quad SPI
en_eem1 = Signal() # EEM1 connected and sync outputs used
self.comb += Cat(en_9910, en_nu, en_eem1).eq(ifc_mode)

self.comb += [
fsen.eq(1),
en_9910.eq(ifc_mode[0] | variant),
en_nu.eq(ifc_mode[1]),
en_eem1.eq(ifc_mode[2]),
[eem[i].oe.eq(0) for i in range(12) if i not in (2, 10)],
eem[2].oe.eq(~en_nu),
eem[10].oe.eq(~en_nu & en_eem1),
Expand Down Expand Up @@ -431,6 +438,7 @@ def __init__(self, platform):
o_Q=att.le)

self.comb += [
cfg.en_9910.eq(en_9910),
cs.eq(Cat(eem[3].i, eem[4].i, ~en_nu & eem[5].i)),
Array(sel)[cs].eq(1), # one-hot
eem[2].o.eq(Array(miso)[cs]),
Expand Down
13 changes: 10 additions & 3 deletions urukul_cpld.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@
("tp", 3, Pins("P136")),
("tp", 4, Pins("P134")),

("ifc_mode", 0,
Pins("P104 P105 P110 P111"),
Misc("PULLUP")),
# P112 is open on Urukul/v1.0
("ifc_mode", 0, Pins("P104 P105 P110 P112")),

# P111 is IFC_MODE_SEL3 on Urukul/v1.0
# 10k low: AD9912, 0R high: AD9910
("variant", 0, Pins("P111")),

# fail save LVDS enable, LVDS mode selection
# high: type 2 receiver, failsafe low
("fsen", 0, Pins("P115")),

("clk", 0,
Subsignal("div", Pins("P11")),
Expand Down

0 comments on commit 2d1c145

Please sign in to comment.