Last active
August 29, 2015 14:17
-
-
Save ravijain056/8e889f343611b6b5cb12 to your computer and use it in GitHub Desktop.
This file contains 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.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The flattening scheme (is different that the unrolling) is reasonable to think about and propose, the good part is you wouldn't need to add lots of additional conversion code, you simply (haha) replace on ND accesses with a flat. The good thing about this approach is you don't is that it will be fairly straightforward in the V* (i.e. which verilog array version do you use).