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