Changes between Version 18 and Version 19 of cores/w3_clock_controller


Ignore:
Timestamp:
Jan 30, 2015, 10:53:56 AM (9 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • cores/w3_clock_controller

    v18 v19  
    129129 * Set output to FPGA as LVDS, bypass divider
    130130}}}
     131
     132The w3_clock_controller_axi core uses the Xilinx PicoBlaze microcontroller to execute the pre-boot clock configuration process. PicoBlaze is an 8-bit microcontroller implemented in the fabric of the FPGA. The PicoBlaze controller executes a program stored in a block RAM whose contents are initialized in the HDL. In effect this block RAM acts as a ROM for the PicoBlaze program. The program is written in assembly code and assembled using the PicoBlaze assembler provided free by Xilinx.
     133
     134For an overview of the PicoBlaze program, refer to [browser:/PlatformSupport/CustomPeripherals/pcores/w3_clock_controller_axi_v4_00_a/hdl/verilog/picoblaze_src/prog_clk_config_boot.psc prog_clk_config_boot.psc pseudo-code description]. The actual assembly program is available in [source:/PlatformSupport/CustomPeripherals/pcores/w3_clock_controller_axi_v4_00_a/hdl/verilog/picoblaze_src/prog_clk_config_boot.psm prog_clk_config_boot.psm].
     135
     136For more information about the PicoBlaze microcontroller:
     137 * [http://www.xilinx.com/products/intellectual-property/picoblaze.html#documentation Xilinx PicoBlaze documentation]
     138 * [http://www.xilinx.com/ipcenter/processor_central/picoblaze/member/ Xilinx PicoBlaze source and tools] - w3_clock_controller_axi HDL uses PicoBlaze version 6 (KCPSM6) Rev 9
    131139
    132140
     
    166174----
    167175
    168 [http://www.xilinx.com/products/intellectual-property/picoblaze.html#documentation Xilinx PicoBlaze documentation]
    169 
    170 [http://www.xilinx.com/ipcenter/processor_central/picoblaze/member/ Xilinx PicoBlaze source and tools] - w3_clock_controller_axi HDL uses PicoBlaze version 6 (KCPSM6) Rev 9
    171 
    172 PicoBlaze pseudo code - see [source:/PlatformSupport/CustomPeripherals/pcores/w3_clock_controller_axi_v4_00_a/hdl/verilog/picoblaze_src/prog_clk_config_boot.psm prog_clk_config_boot.psm] for actual assembly code:
    173 {{{
    174 #!c
    175 
    176 main() {
    177 
    178         if(no_clock_module_mounted) {
    179                 load_configuration(DEV_RF_REF, CFG_NOCM)
    180                 load_configuration(DEV_SAMP, CFG_NOCM)
    181                 load_configuration(DEV_PLL, CFG_NOCM)
    182                 config_complete()
    183         }
    184 
    185         if(cm_mmcx_mounted) {
    186           sw = read_cm_mmcx_sip_sw() //Read SIP switch
    187  
    188                 if(sw == off_off) {
    189                         //Up-Up switches -> ignore clock module
    190                         load_configuration(DEV_RF_REF, CFG_NOCM)
    191                         load_configuration(DEV_SAMP, CFG_NOCM)
    192                         load_configuration(DEV_PLL, CFG_NOCM)
    193                 } else if(sw == off_on) {
    194                         //Up-Down switches -> Config A
    195                         load_configuration(DEV_RF_REF, CFG_CMMMCX_A)
    196                         load_configuration(DEV_SAMP, CFG_CMMMCX_A)
    197                 } else if(sw == on_off) {
    198                         //Down-Up switches -> Config B
    199                         load_configuration(DEV_RF_REF, CFG_CMMMCX_B)
    200                         load_configuration(DEV_SAMP, CFG_CMMMCX_B)
    201                 } else if(sw == on_on) {
    202                         //Down-Up switches -> Config C
    203                         load_configuration(DEV_RF_REF, CFG_CMMMCX_C)
    204                         load_configuration(DEV_SAMP, CFG_CMMMCX_C)
    205                 }
    206  
    207           config_complete()
    208         }
    209 
    210         if(cm_pll_mounted) {
    211                 sw = read_cm_pll_dip_sw() //Read 2 LSB of DIP switch
    212 
    213                 if(sw == off_off) {
    214                         //Down-Down switches -> ignore clock module
    215                         load_configuration(DEV_RF_REF, CFG_NOCM)
    216                         load_configuration(DEV_SAMP, CFG_NOCM)
    217                         load_configuration(DEV_PLL, CFG_NOCM)
    218                         config_complete()
    219                 }
    220        
    221                 wait_for_pll_refclk()
    222        
    223                 if(sw == off_on) {
    224                         //Down-Up switches -> Config A
    225                         load_configuration(DEV_RF_REF, CFG_CMPLL_A)
    226                         load_configuration(DEV_SAMP, CFG_CMPLL_A)
    227                         load_configuration(DEV_PLL, CFG_CMPLL_A)
    228                 } else if(sw == on_off) {
    229                         //Up-Down switches -> Config B
    230                         load_configuration(DEV_RF_REF, CFG_CMPLL_B)
    231                         load_configuration(DEV_SAMP, CFG_CMPLL_B)
    232                         load_configuration(DEV_PLL, CFG_CMPLL_B)
    233                 } else if(sw == on_on) {
    234                         //Up-Up switches -> Config C
    235                         load_configuration(DEV_RF_REF, CFG_CMPLL_C)
    236                         load_configuration(DEV_SAMP, CFG_CMPLL_C)
    237                         load_configuration(DEV_PLL, CFG_CMPLL_C)
    238                 }
    239 
    240                 wait_for_pll_lock()
    241 
    242                 config_complete()
    243         }
    244 }
    245 
    246 load_configuration(req_device, req_cfg) {
    247         if(eeprom[15000] == 0xA5 && eeprom[15001] == 0xCD) {
    248                 cfg_data = copy_cfg_from_eeprom(req_device, req_cfg)
    249         } else {
    250                 cfg_data = copy_cfg_from_rom(req_device, req_cfg)
    251         }
    252 
    253         write_cfg_to_device(req_device, cfg_data)
    254 }
    255 
    256 wait_for_pll_refclk() {
    257         while(read_pll_refclk_status != TOGGLING) {}
    258 }
    259 
    260 wait_for_pll_lock() {
    261         while(read_pll_lock_status != LOCKED) {}
    262 }
    263 
    264 config_complete() {
    265   clear_mmcm_reset() //Starts clocks to FPGA, allows MicroBlaze subsystem to boot
    266   halt()
    267 }
    268 
    269 }}}
    270 
    271176== Driver Initialization ==
    272177