data/full_repos/permissive/133043770/main.v
1: b'%Warning-IMPLICIT: data/full_repos/permissive/133043770/main.v:122: Signal definition not found, creating implicitly: \'IN_RESET\'\n assign IN_RESET = reset;\n        ^~~~~~~~\n                   ... Use "/* verilator lint_off IMPLICIT */" and lint_on around source to disable this message.\n%Error: data/full_repos/permissive/133043770/main.v:43: Cannot find file containing module: \'MIDIIn\'\n MIDIIn midi(\n ^~~~~~\n        ... Looked in:\n             data/full_repos/permissive/133043770,data/full_repos/permissive/133043770/MIDIIn\n             data/full_repos/permissive/133043770,data/full_repos/permissive/133043770/MIDIIn.v\n             data/full_repos/permissive/133043770,data/full_repos/permissive/133043770/MIDIIn.sv\n             MIDIIn\n             MIDIIn.v\n             MIDIIn.sv\n             obj_dir/MIDIIn\n             obj_dir/MIDIIn.v\n             obj_dir/MIDIIn.sv\n%Error: data/full_repos/permissive/133043770/main.v:62: Cannot find file containing module: \'MIDIParse\'\n MIDIParse parser(\n ^~~~~~~~~\n%Error: data/full_repos/permissive/133043770/main.v:78: Cannot find file containing module: \'SampleGenerator\'\n SampleGenerator  \n ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/133043770/main.v:92: Cannot find file containing module: \'ConvolutionFilter\'\n ConvolutionFilter filter(\n ^~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/133043770/main.v:101: Cannot find file containing module: \'EnvelopeFollower\'\n EnvelopeFollower envelope(\n ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/133043770/main.v:110: Cannot find file containing module: \'DAC\'\n DAC out(\n ^~~\n%Warning-WIDTH: data/full_repos/permissive/133043770/main.v:127: Operator ASSIGNW expects 8 bits on the Assign RHS, but Assign RHS\'s VARREF \'envAttack\' generates 7 bits.\n                                                               : ... In instance main\n assign DBG_LED = envAttack;\n                ^\n%Error: Exiting due to 6 error(s), 2 warning(s)\n'
module main(



		output SCLK,
		input CLK_50MHZ,

		input MIDI_IN,

		output [7:0] DBG_LED,

		input [3:0] SW_FILTER,

		output SPI_MOSI,
		output SPI_SCK,
		output DAC_CS,
		output DAC_CLR
    );
	

	wire[7:0] midiByte;
	wire midiReady;
	MIDIIn midi(
		.clock(CLK_50MHZ),
		.uartStream(MIDI_IN),
		.byteOutput(midiByte),
		.byteOutputReady(midiReady)
	);
		

	wire[6:0] midiFrequencyIndex;
	wire[6:0] sampleVelocity;
	wire samplePlaying;
	wire[6:0] envAttack;
	wire[6:0] envRelease;
	wire[6:0] filterFreq;



	wire[1:0] waveMode;

	MIDIParse parser(
		.midiByte(midiByte),
		.midiReady(midiReady),
		.outFrequencyIndex(midiFrequencyIndex),
		.outVelocity(sampleVelocity),
		.outPlaying(samplePlaying),
		.outEnvAttack(envAttack),
		.outEnvRelease(envRelease),
		.outFilterFreq(filterFreq),
		.outWaveSel(waveMode)
	);
	

	wire [11:0] filterSample;
	wire outSampleReady;

	SampleGenerator 	


	#(1)
	sampleGen(
		.inCLK_50MHZ(CLK_50MHZ),
		.inWaveMode(waveMode),
		.inMidiFrequencyIndex(midiFrequencyIndex),
		.outSample(filterSample),
		.outSampleReady(outSampleReady)
	);
	

	wire [11:0] envelopeSample;
	ConvolutionFilter filter(
		.inFilterType(SW_FILTER),
		.inSample(filterSample),
		.inSampleReady(outSampleReady),
		.outSample(envelopeSample)
	);
	

	wire [11:0] dacSample;
	EnvelopeFollower envelope(
		.inSample(envelopeSample),
		.inSampleReady(outSampleReady),
		.inIsPlaying(samplePlaying),
		.inVelocity(sampleVelocity),
		.outSample(dacSample)
	);
	
	reg reset = 0;
	DAC out(
		.IN_CLOCK(CLK_50MHZ),
		.IN_RESET(IN_RESET),
		.IN_BITS(dacSample),
		.IN_SAMPLE_READY(outSampleReady),

		.OUT_SPI_SCK(SPI_SCK),
		.OUT_SPI_MOSI(SPI_MOSI),
		
		.OUT_DAC_CS(DAC_CS), 
		.OUT_DAC_CLR(DAC_CLR)
	);
	assign IN_RESET = reset;
	



	assign DBG_LED = envAttack;
	
endmodule
module main(



		output SCLK,
		input CLK_50MHZ,

		input MIDI_IN,

		output [7:0] DBG_LED,

		input [3:0] SW_FILTER,

		output SPI_MOSI,
		output SPI_SCK,
		output DAC_CS,
		output DAC_CLR
    );

	

	wire[7:0] midiByte;
	wire midiReady;
	MIDIIn midi(
		.clock(CLK_50MHZ),
		.uartStream(MIDI_IN),
		.byteOutput(midiByte),
		.byteOutputReady(midiReady)
	);
		

	wire[6:0] midiFrequencyIndex;
	wire[6:0] sampleVelocity;
	wire samplePlaying;
	wire[6:0] envAttack;
	wire[6:0] envRelease;
	wire[6:0] filterFreq;



	wire[1:0] waveMode;

	MIDIParse parser(
		.midiByte(midiByte),
		.midiReady(midiReady),
		.outFrequencyIndex(midiFrequencyIndex),
		.outVelocity(sampleVelocity),
		.outPlaying(samplePlaying),
		.outEnvAttack(envAttack),
		.outEnvRelease(envRelease),
		.outFilterFreq(filterFreq),
		.outWaveSel(waveMode)
	);
	

	wire [11:0] filterSample;
	wire outSampleReady;

	SampleGenerator 	


	#(1)
	sampleGen(
		.inCLK_50MHZ(CLK_50MHZ),
		.inWaveMode(waveMode),
		.inMidiFrequencyIndex(midiFrequencyIndex),
		.outSample(filterSample),
		.outSampleReady(outSampleReady)
	);
	

	wire [11:0] envelopeSample;
	ConvolutionFilter filter(
		.inFilterType(SW_FILTER),
		.inSample(filterSample),
		.inSampleReady(outSampleReady),
		.outSample(envelopeSample)
	);
	

	wire [11:0] dacSample;
	EnvelopeFollower envelope(
		.inSample(envelopeSample),
		.inSampleReady(outSampleReady),
		.inIsPlaying(samplePlaying),
		.inVelocity(sampleVelocity),
		.outSample(dacSample)
	);
	
	reg reset = 0;
	DAC out(
		.IN_CLOCK(CLK_50MHZ),
		.IN_RESET(IN_RESET),
		.IN_BITS(dacSample),
		.IN_SAMPLE_READY(outSampleReady),

		.OUT_SPI_SCK(SPI_SCK),
		.OUT_SPI_MOSI(SPI_MOSI),
		
		.OUT_DAC_CS(DAC_CS), 
		.OUT_DAC_CLR(DAC_CLR)
	);
	assign IN_RESET = reset;
	



	assign DBG_LED = envAttack;
	
endmodule