Skip to content

Commit

Permalink
Make snap tut2 work -- now using new memory map
Browse files Browse the repository at this point in the history
  • Loading branch information
casper-workshop committed Aug 8, 2019
1 parent 697c58e commit b00ed90
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion casperfpga
2 changes: 1 addition & 1 deletion snap/mlib_devel
15 changes: 6 additions & 9 deletions snap/tut_tge/snap_tut_tge.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def exit_clean():
fpgfile = opts.fpg

# DO NOT CHANGE THESE THREE VALUES!!!
mac_location = 0x00
ip_location = 0x10
port_location = 0x8
mac_location = 0x0c
ip_location = 0x14
port_location = 0x30

try:
#lh = corr.log_handlers.DebugLogHandler()
Expand Down Expand Up @@ -127,7 +127,7 @@ def exit_clean():
fpga.write(rx_core_name, gbe_rx.mac.packed(), mac_location)
fpga.write(rx_core_name, gbe_rx.ip_address.packed(), ip_location)
value = (fpga.read_int(rx_core_name, word_offset = port_location) & 0xffff0000) | (gbe_rx.port & 0xffff)
fpga.write_int(rx_core_name, value, word_offset = port_location)
fpga.write_int(rx_core_name, value, word_offset = port_location//4)
gbe_rx.fabric_enable()
print 'done'

Expand All @@ -140,7 +140,7 @@ def exit_clean():
fpga.write(tx_core_name, gbe_tx.mac.packed(), mac_location)
fpga.write(tx_core_name, gbe_tx.ip_address.packed(), ip_location)
value = (fpga.read_int(tx_core_name, word_offset = port_location) & 0xffff0000) | (gbe_tx.port & 0xffff)
fpga.write_int(tx_core_name, value, word_offset = port_location)
fpga.write_int(tx_core_name, value, word_offset = port_location//4)
gbe_tx.fabric_enable()
print 'done'

Expand Down Expand Up @@ -244,10 +244,7 @@ def exit_clean():
except KeyboardInterrupt:
exit_clean()
except Exception as inst:
print type(inst)
print inst.args
print inst
exit_fail()
raise

exit_clean()

0 comments on commit b00ed90

Please sign in to comment.