view 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
line wrap: on
line source
1 import Trace::*;
2 import Vector::*;
4 `include "asim/provides/audio_pipe_types.bsh"
6 `define MAX_VOICES 4
7 `define MAX_CORES 16
8 `define MAX_PATH_IDS 18
9 `define MAX_PATH_LENGTH 8
11 // The path is hardwired and so should never be stored in a register. Therefore int type rather than Bit type
13 typedef Bit#(32) MemAddr;
14 typedef Int#(TLog#(`MAX_PATH_IDS)) PathId;
15 //typedef Int#(16) Sample;
16 typedef Int#(TLog#(`MAX_VOICES)) VoiceId;
17 typedef Bit#(8) Volume; // This is arbitrarily set to 8 bits or max val 256
19 //The mixer is identified as PathId 0, path end is max
20 PathId mixerId = 0;
21 PathId endId = `MAX_CORES+1;
23 // Path is array of path ids
24 typedef Vector#(`MAX_PATH_LENGTH, PathId) CorePath;
25 CorePath emptyCore = replicate(endId);
27 typedef struct
28 {
29 VoiceId voice;
30 MemAddr startAddr;
31 CorePath route;
32 Volume outVol;
33 } FullPath deriving (Bits, Eq);
35 typedef Maybe#(AudioProcessorUnit) AudioPipeUnit; // deriving (Bits, Eq);
37 typedef struct
38 {
39 VoiceId voice;
40 AudioPipeUnit data;
41 } AudioStream deriving (Bits, Eq);