Skip to content

Instantly share code, notes, and snippets.

@josyb
Created March 26, 2015 13:56
Show Gist options
  • Save josyb/58ca5d4c138e624e9063 to your computer and use it in GitHub Desktop.
Save josyb/58ca5d4c138e624e9063 to your computer and use it in GitHub Desktop.
Guy Eschemann: TypeError: Unexpected type
from myhdl import *
def mpegChannel(clk, rst, s_tx_data_xor_mask_r):
# table = tuple([9,8,7,6])
@always_seq(clk.posedge, reset=rst)
def fsm_seq():
for i in range(4):
# s_tx_data_xor_mask_r.next[(i+1)*8:i*8] = table[i]
s_tx_data_xor_mask_r.next[(i+1)*8:i*8] = i
# if i == 0:
# s_tx_data_xor_mask_r.next[1 + 7:0] = 0
# elif i == 1:
# s_tx_data_xor_mask_r.next[1 + 15:8] = 1
# elif i == 2:
# s_tx_data_xor_mask_r.next[1 + 23:16] = 2
# else:
# s_tx_data_xor_mask_r.next[1 + 31:24] = 3
return instances()
if __name__ == "__main__":
clk = Signal(bool(0))
rst = ResetSignal(0, active=1, async=True)
s_tx_data_xor_mask_r = Signal(intbv(0)[1 + 31:])
toVerilog(mpegChannel, clk, rst, s_tx_data_xor_mask_r)
toVHDL.numeric_ports = False
toVHDL(mpegChannel, clk, rst, s_tx_data_xor_mask_r)
@freddyowusu31
Copy link

hello guy toVerilog(mpegChannel, clk, rst, s_tx_data_xor_mask_r)
toVHDL.numeric_ports = False
toVHDL(mpegChannel, clk, rst, s_tx_data_xor_mask_r)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment