comparison modules/bluespec/Pygar/core/PathTypes.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 4d87fa55a776
comparison
equal deleted inserted replaced
32:0c775e733b81 33:2c8166d205d5
1 import Trace::*; 1 import Trace::*;
2 import Vector::*; 2 import Vector::*;
3
4 `include "asim/provides/audio_pipe_types.bsh"
3 5
4 `define MAX_VOICES 4 6 `define MAX_VOICES 4
5 `define MAX_CORES 16 7 `define MAX_CORES 16
6 `define MAX_PATH_IDS 18 8 `define MAX_PATH_IDS 18
7 `define MAX_PATH_LENGTH 8 9 `define MAX_PATH_LENGTH 8
8 10
9 // The path is hardwired and so should never be stored in a register. Therefore int type rather than Bit type 11 // The path is hardwired and so should never be stored in a register. Therefore int type rather than Bit type
10 12
11 typedef Bit#(32) MemAddr; 13 typedef Bit#(32) MemAddr;
12 typedef Int#(TLog#(`MAX_PATH_IDS)) PathId; 14 typedef Int#(TLog#(`MAX_PATH_IDS)) PathId;
13 typedef Int#(24) Sample; 15 //typedef Int#(16) Sample;
14 typedef Int#(TLog#(`MAX_VOICES)) VoiceId; 16 typedef Int#(TLog#(`MAX_VOICES)) VoiceId;
15 17 typedef Bit#(8) Volume; // This is arbitrarily set to 8 bits or max val 256
16 18
17 //The mixer is identified as PathId 0, path end is max 19 //The mixer is identified as PathId 0, path end is max
18 PathId mixerId = 0; 20 PathId mixerId = 0;
19 PathId endId = `MAX_CORES+1; 21 PathId endId = `MAX_CORES+1;
20 22
25 typedef struct 27 typedef struct
26 { 28 {
27 VoiceId voice; 29 VoiceId voice;
28 MemAddr startAddr; 30 MemAddr startAddr;
29 CorePath route; 31 CorePath route;
32 Volume outVol;
30 } FullPath deriving (Bits, Eq); 33 } FullPath deriving (Bits, Eq);
31 34
35 typedef Maybe#(AudioProcessorUnit) AudioPipeUnit; // deriving (Bits, Eq);
36
37 typedef struct
38 {
39 VoiceId voice;
40 AudioPipeUnit data;
41 } AudioStream deriving (Bits, Eq);