rlm@8: import Trace::*; rlm@8: import Vector::*; rlm@8: punk@33: `include "asim/provides/audio_pipe_types.bsh" punk@33: rlm@8: `define MAX_VOICES 4 rlm@8: `define MAX_CORES 16 rlm@8: `define MAX_PATH_IDS 18 rlm@8: `define MAX_PATH_LENGTH 8 rlm@8: rlm@8: // The path is hardwired and so should never be stored in a register. Therefore int type rather than Bit type rlm@8: rlm@8: typedef Bit#(32) MemAddr; rlm@8: typedef Int#(TLog#(`MAX_PATH_IDS)) PathId; punk@33: //typedef Int#(16) Sample; rlm@8: typedef Int#(TLog#(`MAX_VOICES)) VoiceId; punk@43: typedef Int#(8) Volume; // This is arbitrarily set to 8 bits or max val 256 rlm@8: rlm@8: //The mixer is identified as PathId 0, path end is max rlm@8: PathId mixerId = 0; rlm@8: PathId endId = `MAX_CORES+1; rlm@8: rlm@8: // Path is array of path ids rlm@8: typedef Vector#(`MAX_PATH_LENGTH, PathId) CorePath; rlm@8: CorePath emptyCore = replicate(endId); rlm@8: rlm@8: typedef struct rlm@8: { rlm@8: VoiceId voice; rlm@8: MemAddr startAddr; rlm@8: CorePath route; punk@33: Volume outVol; rlm@8: } FullPath deriving (Bits, Eq); rlm@8: punk@33: typedef Maybe#(AudioProcessorUnit) AudioPipeUnit; // deriving (Bits, Eq); punk@33: punk@33: typedef struct punk@33: { punk@33: VoiceId voice; punk@33: AudioPipeUnit data; punk@33: } AudioStream deriving (Bits, Eq);