This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from myhdl import * | |
def switchchannels(mem2d, q, clk): | |
def assign_los(mem1d_a, mem1d_b): | |
print(mem1d_a, mem1d_b) | |
for i in range(len(mem1d_a)): | |
mem1d_a[i].next = mem1d_b[i] | |
return mem1d_a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from myhdl import * | |
def switchchannels(mem2d, q, clk): | |
def assign_los(mem1d_a, mem1d_b): | |
print(mem1d_a, mem1d_b) | |
for i in range(len(mem1d_a)): | |
mem1d_a[i].next = mem1d_b[i] | |
return mem1d_a | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# say u have 3 channels transmitting 4-bit signals | |
a = [[1,0,0,1],[1,1,0,0],[1,1,0,1]] | |
# say u flatten it to get b | |
b = [1,0,0,1,1,1,0,0,1,1,0,1] | |
#so when you wish to access signal in 3rd channel you need to | |
print(a[2]) | |
print(b[4*(2-1):4*(2)]) | |
#now when you just wish to assign channel 2 to 3 and 3 to 2...problem would really start to exponentially increase in | |
#flattened part and the point of generalising ND list using flattening seems to be lost...please correct me if i am wrng.. |
NewerOlder