Mercurial > pygar
annotate core/src/PathTypes.bsv @ 1:91a1f76ddd62 pygar svn.2
[svn r2] Adding initial lab 5 source
author | punk |
---|---|
date | Tue, 13 Apr 2010 17:34:33 -0400 |
parents | |
children | 996f1d6cd010 |
rev | line source |
---|---|
punk@1 | 1 import Trace::*; |
punk@1 | 2 import Vector::*; |
punk@1 | 3 |
punk@1 | 4 `define MAX_VOICES 4 |
punk@1 | 5 `define MAX_CORES 16 |
punk@1 | 6 `define MAX_PATH_IDS 18 |
punk@1 | 7 `define MAX_PATH_LENGTH 8 |
punk@1 | 8 |
punk@1 | 9 // The path is hardwired and so should never be stored in a register. Therefore int type rather than Bit type |
punk@1 | 10 |
punk@1 | 11 typedef Bit#(32) MemAddr; |
punk@1 | 12 typedef Int#(TLog#(`MAX_PATH_IDS)) PathId; |
punk@1 | 13 |
punk@1 | 14 //The mixer is identified as PathId 0, path end is max |
punk@1 | 15 PathId mixerId = 0; |
punk@1 | 16 PathId endId = `MAX_CORES+1; |
punk@1 | 17 |
punk@1 | 18 // Path is array of path ids |
punk@1 | 19 typedef Vector#(`MAX_PATH_LENGTH, PathId) CorePath; |
punk@1 | 20 typedef struct |
punk@1 | 21 { |
punk@1 | 22 MemAddr startAddr; |
punk@1 | 23 CorePath route; |
punk@1 | 24 } FullPath deriving(Eq, Bits); |
punk@1 | 25 |
punk@1 | 26 vector#(`MAX_VOICES, FullPath) routeTable; |
punk@1 | 27 CorePath aroute = {1, 2}; |
punk@1 | 28 routeTable = {{12, aroute},{1, aroute}}; |
punk@1 | 29 |
punk@1 | 30 |
punk@1 | 31 |