changeset 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 cdad17407328
children 74716e9a81cc
files core/src/PathTypes.bsv core/src/RoutingTable.bsv
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/core/src/PathTypes.bsv	Wed Apr 21 23:22:10 2010 -0400
     1.2 +++ b/core/src/PathTypes.bsv	Wed Apr 21 23:37:12 2010 -0400
     1.3 @@ -12,7 +12,7 @@
     1.4  typedef Int#(TLog#(`MAX_PATH_IDS))  PathId;
     1.5  typedef Int#(24) Sample;
     1.6  typedef Int#(TLog#(`MAX_VOICES)) VoiceId;
     1.7 -
     1.8 +typedef Bit#(8) Volume; // This is arbitrarily set to 8 bits or max val 256
     1.9  
    1.10  //The mixer is identified as PathId 0, path end is max 
    1.11  PathId mixerId = 0;
    1.12 @@ -27,5 +27,6 @@
    1.13    VoiceId   voice;
    1.14    MemAddr   startAddr;
    1.15    CorePath  route;
    1.16 +  Volume    outVol;
    1.17  } FullPath deriving (Bits, Eq);
    1.18  
     2.1 --- a/core/src/RoutingTable.bsv	Wed Apr 21 23:22:10 2010 -0400
     2.2 +++ b/core/src/RoutingTable.bsv	Wed Apr 21 23:37:12 2010 -0400
     2.3 @@ -3,12 +3,13 @@
     2.4  import PathTypes::*;
     2.5  
     2.6  function FullPath genEmptyPaths (Integer a) ;
     2.7 -   FullPath empt = FullPath {voice: fromInteger(a), startAddr: 0, route: emptyCore};
     2.8 +   FullPath empt = FullPath {voice: fromInteger(a), startAddr: 0, route: emptyCore, outVol: 0};
     2.9     return (empt);
    2.10  endfunction
    2.11  
    2.12  interface RoutingTable;
    2.13     method FullPath getPath(Integer voiceNo);
    2.14 +   method getMixerScalar();
    2.15  endinterface
    2.16  
    2.17  module mkRoutingTable(RoutingTable);
    2.18 @@ -25,6 +26,7 @@
    2.19     routeTable[0].startAddr = 0;  //where is this really going to come from?
    2.20     routeTable[0].route[0] = 3;
    2.21     routeTable[0].route[1] = mixerId;
    2.22 +   routeTable[0].outVol = 200;
    2.23     //rest are already initialized toinvalid
    2.24  
    2.25     // or if you just want to update a straight list, this longer emplate works.
    2.26 @@ -40,13 +42,17 @@
    2.27        return outPath;
    2.28     endfunction
    2.29     routeTable[1].route = createVoice1Route;
    2.30 -   routeTable[1].startAddr = 0;
    2.31 +   routeTable[1].startAddr = 0;   
    2.32 +   routeTable[1].outVol = 200;
    2.33 +
    2.34  
    2.35     //remaining voices are all initialized to empty.
    2.36     
    2.37     method FullPath getPath(Integer a);
    2.38        return routeTable[a];
    2.39     endmethod
    2.40 +
    2.41 +   method Integer(
    2.42     
    2.43  endmodule
    2.44