diff modules/bluespec/Pygar/core/RoutingTable.bsv @ 33:2c8166d205d5 pygar svn.34

[svn r34] uses scratchpad, set up for audio through c
author punk
date Tue, 04 May 2010 10:13:53 -0400
parents 74716e9a81cc
children
line wrap: on
line diff
     1.1 --- a/modules/bluespec/Pygar/core/RoutingTable.bsv	Mon May 03 09:53:56 2010 -0400
     1.2 +++ b/modules/bluespec/Pygar/core/RoutingTable.bsv	Tue May 04 10:13:53 2010 -0400
     1.3 @@ -3,12 +3,13 @@
     1.4  import PathTypes::*;
     1.5  
     1.6  function FullPath genEmptyPaths (Integer a) ;
     1.7 -   FullPath empt = FullPath {voice: fromInteger(a), startAddr: 0, route: emptyCore};
     1.8 +   FullPath empt = FullPath {voice: fromInteger(a), startAddr: 0, route: emptyCore, outVol: 0};
     1.9     return (empt);
    1.10  endfunction
    1.11  
    1.12  interface RoutingTable;
    1.13     method FullPath getPath(Integer voiceNo);
    1.14 +   method Vector#(`MAX_VOICES, Volume) getMixerScalars();
    1.15  endinterface
    1.16  
    1.17  module mkRoutingTable(RoutingTable);
    1.18 @@ -25,9 +26,10 @@
    1.19     routeTable[0].startAddr = 0;  //where is this really going to come from?
    1.20     routeTable[0].route[0] = 3;
    1.21     routeTable[0].route[1] = mixerId;
    1.22 +   routeTable[0].outVol = 200;
    1.23     //rest are already initialized toinvalid
    1.24  
    1.25 -   // or if you just want to update a straight list, this longer emplate works.
    1.26 +   // or if you just want to update a straight list, this longer template works.
    1.27     function CorePath createVoice1Route();
    1.28        CorePath outPath = emptyCore;
    1.29        
    1.30 @@ -40,13 +42,21 @@
    1.31        return outPath;
    1.32     endfunction
    1.33     routeTable[1].route = createVoice1Route;
    1.34 -   routeTable[1].startAddr = 0;
    1.35 +   routeTable[1].startAddr = 0;   
    1.36 +   routeTable[1].outVol = 200;
    1.37  
    1.38     //remaining voices are all initialized to empty.
    1.39     
    1.40 -   method FullPath getPath(Integer a);
    1.41 +   method FullPath getPath(Integer a);      
    1.42        return routeTable[a];
    1.43     endmethod
    1.44 +
    1.45 +   method Vector#(`MAX_VOICES, Volume) getMixerScalars();
    1.46 +      Vector#(`MAX_VOICES, Volume) scalars = newVector();
    1.47 +      for(Integer i = 0; i < `MAX_VOICES; i = i+1)
    1.48 +	 scalars[i] = routeTable[i].outVol;
    1.49 +      return scalars;
    1.50 +   endmethod
    1.51     
    1.52  endmodule
    1.53