comparison core/src/RoutingTable.bsv @ 7:7393cd19371e pygar svn.8

[svn r8] added volume to routing table and types
author punk
date Wed, 21 Apr 2010 23:37:12 -0400
parents c4438eca4bc4
children
comparison
equal deleted inserted replaced
6:cdad17407328 7:7393cd19371e
1 import Trace::*; 1 import Trace::*;
2 import Vector::*; 2 import Vector::*;
3 import PathTypes::*; 3 import PathTypes::*;
4 4
5 function FullPath genEmptyPaths (Integer a) ; 5 function FullPath genEmptyPaths (Integer a) ;
6 FullPath empt = FullPath {voice: fromInteger(a), startAddr: 0, route: emptyCore}; 6 FullPath empt = FullPath {voice: fromInteger(a), startAddr: 0, route: emptyCore, outVol: 0};
7 return (empt); 7 return (empt);
8 endfunction 8 endfunction
9 9
10 interface RoutingTable; 10 interface RoutingTable;
11 method FullPath getPath(Integer voiceNo); 11 method FullPath getPath(Integer voiceNo);
12 method getMixerScalar();
12 endinterface 13 endinterface
13 14
14 module mkRoutingTable(RoutingTable); 15 module mkRoutingTable(RoutingTable);
15 Vector#(`MAX_VOICES, FullPath) routeTable = genWith(genEmptyPaths); 16 Vector#(`MAX_VOICES, FullPath) routeTable = genWith(genEmptyPaths);
16 17
23 24
24 //demonstrate two ways of building the routeTable 25 //demonstrate two ways of building the routeTable
25 routeTable[0].startAddr = 0; //where is this really going to come from? 26 routeTable[0].startAddr = 0; //where is this really going to come from?
26 routeTable[0].route[0] = 3; 27 routeTable[0].route[0] = 3;
27 routeTable[0].route[1] = mixerId; 28 routeTable[0].route[1] = mixerId;
29 routeTable[0].outVol = 200;
28 //rest are already initialized toinvalid 30 //rest are already initialized toinvalid
29 31
30 // or if you just want to update a straight list, this longer emplate works. 32 // or if you just want to update a straight list, this longer emplate works.
31 function CorePath createVoice1Route(); 33 function CorePath createVoice1Route();
32 CorePath outPath = emptyCore; 34 CorePath outPath = emptyCore;
38 outPath[i] = route[i]; 40 outPath[i] = route[i];
39 41
40 return outPath; 42 return outPath;
41 endfunction 43 endfunction
42 routeTable[1].route = createVoice1Route; 44 routeTable[1].route = createVoice1Route;
43 routeTable[1].startAddr = 0; 45 routeTable[1].startAddr = 0;
46 routeTable[1].outVol = 200;
47
44 48
45 //remaining voices are all initialized to empty. 49 //remaining voices are all initialized to empty.
46 50
47 method FullPath getPath(Integer a); 51 method FullPath getPath(Integer a);
48 return routeTable[a]; 52 return routeTable[a];
49 endmethod 53 endmethod
54
55 method Integer(
50 56
51 endmodule 57 endmodule
52 58