test: we can now test regs with Etherbone
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 16 Feb 2015 22:39:12 +0000 (23:39 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 17 Feb 2015 00:15:06 +0000 (01:15 +0100)
test/config.py
test/test_regs.py

index 44d8fcee479971f3b15f0ee2bd4514db9c11290e..5d367ccd3d2c2ef8ae2898a9aff978cebae182db 100644 (file)
@@ -1,9 +1,14 @@
-from litescope.host.driver import LiteScopeUART2WBDriver
+use_uart = 0
+use_eth = 1
 
 csr_csv_file = "./csr.csv"
 busword = 32
 debug_wb = False
 
-com = 2
-baud = 921600
-wb = LiteScopeUART2WBDriver(com, baud, csr_csv_file, busword, debug_wb)
\ No newline at end of file
+if use_uart:
+       from litescope.host.driver import LiteScopeUART2WBDriver
+       wb = LiteScopeUART2WBDriver(2, 921600, csr_csv_file, busword, debug_wb)
+
+if use_eth:
+       from litescope.host.driver import LiteScopeEtherboneDriver
+       wb = LiteScopeEtherboneDriver("192.168.1.40", 20000, csr_csv_file, debug_wb)
index a62de8c89bc03850b1ade4f3f63acef5083aff06..4b9f9bc726e8c21d6786deb2ac96ff0de26746fd 100644 (file)
@@ -7,5 +7,8 @@ regs.phy_crg_reset.write(1)
 print("sysid     : 0x%04x" %regs.identifier_sysid.read())
 print("revision  : 0x%04x" %regs.identifier_revision.read())
 print("frequency : %d MHz" %(regs.identifier_frequency.read()/1000000))
+SRAM_BASE = 0x02000000
+wb.write(SRAM_BASE, [i for i in range(64)])
+print(wb.read(SRAM_BASE, 64))
 ###
 wb.close()