Store the initialized submodules in self
It has a prettier syntax highligting
This commit is contained in:
parent
ff49b96dea
commit
7f6b133241
|
@ -12,16 +12,16 @@ Top = subclass Elaboratable where
|
||||||
@ledg = platform.request "led_g"
|
@ledg = platform.request "led_g"
|
||||||
@seg7 = platform.request "seven_seg"
|
@seg7 = platform.request "seven_seg"
|
||||||
|
|
||||||
blinker1 = Blinker$ int (freq // 3)
|
@blinker = Blinker$ freq // 3
|
||||||
m.submodules += blinker1
|
m.submodules += @blinker
|
||||||
|
|
||||||
blinker2 = Pulser$ int (freq // 3)
|
@pulser = Pulser$ freq // 3
|
||||||
m.submodules += blinker2
|
m.submodules += @pulser
|
||||||
|
|
||||||
comb$ drive @ledr blinker1.out
|
sync$ drive @ledr @blinker.out
|
||||||
|
|
||||||
hello = Signal 1 reset: 1
|
hello = Signal 1 reset: 1
|
||||||
when blinker2.out $ ->
|
when @pulser.out $ ->
|
||||||
sync$ drive hello ~hello
|
sync$ drive hello ~hello
|
||||||
sync$ drive @ledg hello
|
sync$ drive @ledg hello
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue