mirror of
https://github.com/supleed2/EIE4-FYP.git
synced 2024-11-10 04:15:49 +00:00
Add testing SystemVerilog and LiteX Module
This commit is contained in:
parent
9322fe0fd4
commit
e1b0d5c28c
15
rtl/flip.sv
Normal file
15
rtl/flip.sv
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
module flip
|
||||||
|
( input var clk
|
||||||
|
, output var ledr
|
||||||
|
, output var ledg
|
||||||
|
, output var ledb
|
||||||
|
);
|
||||||
|
|
||||||
|
logic [31:0] counter;
|
||||||
|
|
||||||
|
always_ff @(posedge clk)
|
||||||
|
counter <= counter + 1;
|
||||||
|
|
||||||
|
assign {ledr, ledg, ledb} = ~counter[27:25];
|
||||||
|
|
||||||
|
endmodule
|
20
testLED.py
Normal file
20
testLED.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
from migen import *
|
||||||
|
from migen.genlib.misc import WaitTimer
|
||||||
|
|
||||||
|
from litex.soc.interconnect.csr import *
|
||||||
|
|
||||||
|
# Test LED Module ----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestLed(Module, AutoCSR):
|
||||||
|
def __init__(self, platform, pads):
|
||||||
|
self.pads = pads
|
||||||
|
leds = Signal(3)
|
||||||
|
self.comb += pads.eq(leds)
|
||||||
|
self.specials += Instance("flip",
|
||||||
|
i_clk = ClockSignal(),
|
||||||
|
o_ledr = leds[0],
|
||||||
|
o_ledg = leds[1],
|
||||||
|
o_ledb = leds[2]
|
||||||
|
)
|
||||||
|
platform.add_source("rtl/flip.sv")
|
||||||
|
|
Loading…
Reference in a new issue