mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
test on hardware and clean up/fix
This commit is contained in:
parent
9da8188b71
commit
9960ca010a
4 changed files with 32 additions and 21 deletions
10
README
10
README
|
@ -101,13 +101,19 @@ devel [AT] lists.m-labs.hk.
|
||||||
git clone https://github.com/enjoy-digital/litesata
|
git clone https://github.com/enjoy-digital/litesata
|
||||||
|
|
||||||
6. Build and load BIST design (only for KC705 for now):
|
6. Build and load BIST design (only for KC705 for now):
|
||||||
python3 make.py all
|
python3 make.py all (-s BISTSoCDevel to add LiteScopeLA)
|
||||||
|
|
||||||
7. Test design (only for KC705 for now):
|
7. Test design (only for KC705 for now):
|
||||||
go to ./test directory and run:
|
go to ./test directory and run:
|
||||||
python3 bist.py
|
python3 bist.py
|
||||||
|
|
||||||
8. If you only want to build the core and use it with your
|
8. Visualize Link Layer transactions (if BISTSoCDevel):
|
||||||
|
go to ./test directory and run:
|
||||||
|
python3 test_la.py [your_cond]
|
||||||
|
your_cond can be wr_cmd, id_cmd, rd_resp, ...
|
||||||
|
(open test_la.py to see all conditions or add yours)
|
||||||
|
|
||||||
|
9. If you only want to build the core and use it with your
|
||||||
regular design flow:
|
regular design flow:
|
||||||
python3 make.py -t core build-core
|
python3 make.py -t core build-core
|
||||||
|
|
||||||
|
|
|
@ -226,6 +226,7 @@ class LiteSATABISTIdentify(Module):
|
||||||
source, sink = user_port.sink, user_port.source
|
source, sink = user_port.sink, user_port.source
|
||||||
|
|
||||||
self.fsm = fsm = FSM(reset_state="IDLE")
|
self.fsm = fsm = FSM(reset_state="IDLE")
|
||||||
|
self.submodules += fsm
|
||||||
fsm.act("IDLE",
|
fsm.act("IDLE",
|
||||||
self.done.eq(1),
|
self.done.eq(1),
|
||||||
If(self.start,
|
If(self.start,
|
||||||
|
@ -288,4 +289,6 @@ class LiteSATABIST(Module, AutoCSR):
|
||||||
generator = LiteSATABISTUnitCSR(generator)
|
generator = LiteSATABISTUnitCSR(generator)
|
||||||
checker = LiteSATABISTUnitCSR(checker)
|
checker = LiteSATABISTUnitCSR(checker)
|
||||||
identify = LiteSATABISTIdentifyCSR(identify)
|
identify = LiteSATABISTIdentifyCSR(identify)
|
||||||
self.submodules += generator, checker, identify
|
self.submodules.generator = generator
|
||||||
|
self.submodules.checker = checker
|
||||||
|
self.submodules.identify = identify
|
||||||
|
|
|
@ -136,7 +136,6 @@ class BISTSoC(GenSoC, AutoCSR):
|
||||||
"sata": 10,
|
"sata": 10,
|
||||||
}
|
}
|
||||||
csr_map.update(GenSoC.csr_map)
|
csr_map.update(GenSoC.csr_map)
|
||||||
|
|
||||||
def __init__(self, platform):
|
def __init__(self, platform):
|
||||||
clk_freq = 166*1000000
|
clk_freq = 166*1000000
|
||||||
GenSoC.__init__(self, platform, clk_freq)
|
GenSoC.__init__(self, platform, clk_freq)
|
||||||
|
@ -152,7 +151,7 @@ class BISTSoC(GenSoC, AutoCSR):
|
||||||
|
|
||||||
class BISTSoCDevel(BISTSoC, AutoCSR):
|
class BISTSoCDevel(BISTSoC, AutoCSR):
|
||||||
csr_map = {
|
csr_map = {
|
||||||
"la": 10
|
"la": 20
|
||||||
}
|
}
|
||||||
csr_map.update(BISTSoC.csr_map)
|
csr_map.update(BISTSoC.csr_map)
|
||||||
def __init__(self, platform):
|
def __init__(self, platform):
|
||||||
|
|
|
@ -12,16 +12,26 @@ wb.open()
|
||||||
regs = wb.regs
|
regs = wb.regs
|
||||||
###
|
###
|
||||||
|
|
||||||
|
trig = "now"
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
print("Need trigger condition!")
|
print("No trigger condition, triggering immediately!")
|
||||||
sys.exit(0)
|
else:
|
||||||
|
trig = sys.argv[1]
|
||||||
|
|
||||||
conditions = {}
|
conditions = {}
|
||||||
|
conditions["now"] = {}
|
||||||
|
conditions["id_cmd"] = {
|
||||||
|
"sata_command_tx_sink_stb" : 1,
|
||||||
|
"sata_command_tx_sink_payload_identify" : 1,
|
||||||
|
}
|
||||||
|
conditions["id_resp"] = {
|
||||||
|
"source_source_payload_data" : primitives["X_RDY"],
|
||||||
|
}
|
||||||
conditions["wr_cmd"] = {
|
conditions["wr_cmd"] = {
|
||||||
"sata_command_tx_sink_stb" : 1,
|
"sata_command_tx_sink_stb" : 1,
|
||||||
"sata_command_tx_sink_payload_write" : 1,
|
"sata_command_tx_sink_payload_write" : 1,
|
||||||
}
|
}
|
||||||
conditions["wr_dma_activate"] = {
|
conditions["wr_resp"] = {
|
||||||
"sata_command_rx_source_stb" : 1,
|
"sata_command_rx_source_stb" : 1,
|
||||||
"sata_command_rx_source_payload_write" : 1,
|
"sata_command_rx_source_payload_write" : 1,
|
||||||
}
|
}
|
||||||
|
@ -29,27 +39,20 @@ conditions["rd_cmd"] = {
|
||||||
"sata_command_tx_sink_stb" : 1,
|
"sata_command_tx_sink_stb" : 1,
|
||||||
"sata_command_tx_sink_payload_read" : 1,
|
"sata_command_tx_sink_payload_read" : 1,
|
||||||
}
|
}
|
||||||
conditions["rd_data"] = {
|
conditions["rd_resp"] = {
|
||||||
"sata_command_rx_source_stb" : 1,
|
"sata_command_rx_source_stb" : 1,
|
||||||
"sata_command_rx_source_payload_read" : 1,
|
"sata_command_rx_source_payload_read" : 1,
|
||||||
}
|
}
|
||||||
conditions["id_cmd"] = {
|
|
||||||
"sata_command_tx_sink_stb" : 1,
|
|
||||||
"sata_command_tx_sink_payload_identify" : 1,
|
|
||||||
}
|
|
||||||
conditions["id_pio_setup"] = {
|
|
||||||
"source_source_payload_data" : primitives["X_RDY"],
|
|
||||||
}
|
|
||||||
|
|
||||||
la.prog_term(port=0, cond=conditions[sys.argv[1]])
|
la.prog_term(port=0, cond=conditions[trig])
|
||||||
la.prog_sum("term")
|
la.prog_sum("term")
|
||||||
|
|
||||||
# Trigger / wait / receive
|
# Trigger / wait / receive
|
||||||
la.trigger(offset=512, length=2000)
|
la.trigger(offset=64, length=1024)
|
||||||
|
|
||||||
#identify.run()
|
#identify.run(blocking=False)
|
||||||
generator.run(0, 2, 1, 0)
|
generator.run(0, 2, 1, 0, blocking=False)
|
||||||
#checker.run(0, 2, 1, 0)
|
#checker.run(0, 2, 1, 0, blocking=False)
|
||||||
la.wait_done()
|
la.wait_done()
|
||||||
|
|
||||||
la.read()
|
la.read()
|
Loading…
Reference in a new issue