Difference between revisions of "Sample MachXO2 Lattice Diamond Project"
Line 1: | Line 1: | ||
'''MachXO2 Lattice Diamond Project''' | '''MachXO2 Lattice Diamond Project''' | ||
There are two implementations in the project: user and config for User Mode and Configure Mode respectively. Those two implementations share the same .lpf file. The Diamond project and file structure look like the following: | There are two implementations in the project: user and config for User Mode and Configure Mode respectively. Those two implementations share the same .lpf file. The Diamond project and file structure look like the following: | ||
User implementation: | User implementation: | ||
power_control | power_control | ||
|___power_control.ldf | |___power_control.ldf | ||
|___power_control.lpf | |___power_control.lpf | ||
|___Strategy1.sty | |___Strategy1.sty | ||
|___user | |___user | ||
|___source | |___source | ||
|___adc_top.v | |___adc_top.v | ||
|___box_ave.v | |___box_ave.v | ||
|___demo_top_user.v | |___demo_top_user.v | ||
|___count16_ldrg.vhd | |___count16_ldrg.vhd | ||
|___display.v | |___display.v | ||
|___lcd_display.v | |___lcd_display.v | ||
|___lcd4digit.v | |___lcd4digit.v | ||
|___LCDEncoding4to1.v | |___LCDEncoding4to1.v | ||
|___lcdencoding4to1com.v | |___lcdencoding4to1com.v | ||
|___pwm.v | |___pwm.v | ||
|___sigmadelta_adc.v | |___sigmadelta_adc.v | ||
|___ipexpress/LCDCharMap/LCDCharMap.ipx7 '''MachXO2 Low Power Control Demo''' | |||
|___ipexpress/LCDCharMap/LCDCharMap.ipx7 '''MachXO2 Low Power Control Demo ''' | |||
Line 90: | Line 49: | ||
Config Implementation: | Config Implementation: | ||
power_control | power_control | ||
|___power_control.ldf | |___power_control.ldf | ||
|___power_control.lpf | |___power_control.lpf | ||
|___Strategy1.sty | |___Strategy1.sty | ||
|___config | |___config | ||
|___source | |___source | ||
|___adc_top.v | |___adc_top.v | ||
|___box_ave.v | |___box_ave.v | ||
|___demo_top_config.v | |___demo_top_config.v | ||
|___count16_ldrg.vhd | |___count16_ldrg.vhd | ||
|___display.v | |___display.v | ||
|___lcd_display.v | |___lcd_display.v | ||
|___lcd4digit.v | |___lcd4digit.v | ||
|___LCDEncoding4to1.v | |___LCDEncoding4to1.v | ||
|___lcdencoding4to1com.v | |___lcdencoding4to1com.v | ||
|___pwm.v | |___pwm.v | ||
|___sigmadelta_adc.v | |___sigmadelta_adc.v | ||
|___wb_master.v | |___wb_master.v | ||
|___ipexpress/efb_spi_i2c/efb_spi_i2c.ipx | |___ipexpress/efb_spi_i2c/efb_spi_i2c.ipx | ||
|___ipexpress/pwr_ctrl/pwr_ctrl.ipx | |___ipexpress/pwr_ctrl/pwr_ctrl.ipx | ||
|___ipexpress/LCDCharMap/LCDCharMap.ipx | |___ipexpress/LCDCharMap/LCDCharMap.ipx | ||
Line 190: | Line 108: | ||
OSCH OSCH_inst ( | OSCH OSCH_inst ( | ||
.STDBY( STDBY ), // STDBY=1, stop oscillator; STDBY=0, start oscillator. | .STDBY( STDBY ), // STDBY=1, stop oscillator; STDBY=0, start oscillator. | ||
.OSC ( clk_osc ), | .OSC ( clk_osc ), | ||
.SEDSTDBY ( ) | .SEDSTDBY ( ) | ||
/* synthesis syn_noprune = 1 */ ; // to prevent the oscillator from being optimized away | /* synthesis syn_noprune = 1 */ ; // to prevent the oscillator from being optimized away | ||
Line 212: | Line 121: | ||
In RTL coding, there '''Oscillator Instantiation'''1. An OSCH module needs to be instantiated in the code. | |||
In RTL coding, there '''Oscillator Instantiation '''1. An OSCH module needs to be instantiated in the code. |
Latest revision as of 20:50, 7 July 2012
MachXO2 Lattice Diamond Project
There are two implementations in the project: user and config for User Mode and Configure Mode respectively. Those two implementations share the same .lpf file. The Diamond project and file structure look like the following:
User implementation:
power_control
|___power_control.ldf
|___power_control.lpf
|___Strategy1.sty
|___user
|___source
|___adc_top.v
|___box_ave.v
|___demo_top_user.v
|___count16_ldrg.vhd
|___display.v
|___lcd_display.v
|___lcd4digit.v
|___LCDEncoding4to1.v
|___lcdencoding4to1com.v
|___pwm.v
|___sigmadelta_adc.v
|___ipexpress/LCDCharMap/LCDCharMap.ipx7 MachXO2 Low Power Control Demo
Config Implementation:
power_control
|___power_control.ldf
|___power_control.lpf
|___Strategy1.sty
|___config
|___source
|___adc_top.v
|___box_ave.v
|___demo_top_config.v
|___count16_ldrg.vhd
|___display.v
|___lcd_display.v
|___lcd4digit.v
|___LCDEncoding4to1.v
|___lcdencoding4to1com.v
|___pwm.v
|___sigmadelta_adc.v
|___wb_master.v
|___ipexpress/efb_spi_i2c/efb_spi_i2c.ipx
|___ipexpress/pwr_ctrl/pwr_ctrl.ipx
|___ipexpress/LCDCharMap/LCDCharMap.ipx
The following are necessary to enable the power control for the on-chip oscillator:
2.The STDBY port of OSCH needs to be set/reset to put the oscillator into Standby or Wake mode.
The Verilog code for OSCH instantiation looks like the following:
OSCH OSCH_inst (
.STDBY( STDBY ), // STDBY=1, stop oscillator; STDBY=0, start oscillator.
.OSC ( clk_osc ),
.SEDSTDBY ( )
/* synthesis syn_noprune = 1 */ ; // to prevent the oscillator from being optimized away
The on-chip oscillator can be turned on/off in two ways: through internal user logic and/or through the external I2C or SPI port.
In RTL coding, there Oscillator Instantiation1. An OSCH module needs to be instantiated in the code.