module DACTest_SelfOscillating (

	// Outputs:
	o$DAC,	// DAC word
	o$MicroReset,
	o$RAMoe
);

// Port mode declarations:
output	[6:0]	o$DAC;
output	o$MicroReset;
output	o$RAMoe;


// Registered identifiers:
reg	[6:0]	o$DAC;

// Wire identifiers:
wire w$Oscillator; 
wire w$Clock; 


//----- Functionality -----

// Disable micro and SRAM
assign	o$MicroReset = 1;
assign	o$RAMoe = 1;

// Instantiate the internal oscillator;
// Available frequencies are 8MHz, 500kHz, 16kHz, 490Hz, and 15Hz
OSC4 oscut (.F8M(), .F500K(), .F16K(w$Oscillator), .F490(), .F15() ); 

// Instantiate global buffer to drive clock signal (can't use
// oscillator output directly)
BUFG bufut (.I(w$Oscillator), .O(w$Clock)); 

// Free-running 7-bit up-counter
always @ (posedge w$Clock)
	o$DAC <= o$DAC + 1;

endmodule