# Exporting Component Description of Soft_Processor to TCL
# Family: PolarFire
# Part Number: MPF300TS-1FCG1152I
# Create and Configure the core component Soft_Processor
create_and_configure_core -core_vlnv Actel:DirectCore:COREABC:$COREABCver -component_name {Soft_Processor} -params {\
"ABCCODE:$Rate_select
    
    IOREAD 
    NOP
    NOP
    NOP
    JUMP IF INPUT0 $Rate_change_1_25_G
    NOP
    NOP
    JUMP IF INPUT1 $Rate_change_2_5_G
    NOP
    NOP
    JUMP IF INPUT2 $Rate_change_5_G
    NOP
    NOP
    JUMP IF INPUT3 $Clock_change_out0_out1
    NOP
    NOP
    JUMP IF INPUT4 $Clock_change_out2_out3

JUMP $Rate_select
  
    
$Rate_change_1_25_G

IOWRT 0x011
//SER_RSTPD 
APBWRT DAT 0 0x1078 0x00000003 
//DES_RSTPD
APBWRT DAT 0 0x104C 0x00000032
      
//TXPLL_DIV_1
    APBWRT DAT 1 0x0010 0x0140000
//TXPLL_DIV_2
    APBWRT DAT 1 0x0014 0x1000000
//SER_CLK_CTRL
    APBWRT DAT 0 0x1074 0x0000073
//DES_RXPLL_DIV
    APBWRT DAT 0 0x1040 0x000420A
    
JUMP $Reset_release

$Rate_change_2_5_G

IOWRT 0x011
//SER_RSTPD 
APBWRT DAT 0 0x1078 0x00000003 
//DES_RSTPD
APBWRT DAT 0 0x104C 0x00000032

//TXPLL_DIV_1
    APBWRT DAT 1 0x0010 0x0140000
//TXPLL_DIV_2
    APBWRT DAT 1 0x0014 0x1000000
//SER_CLK_CTRL
    APBWRT DAT 0 0x1074 0x0000071
//DES_RXPLL_DIV
    APBWRT DAT 0 0x1040 0x0002214

JUMP $Reset_release

$Rate_change_5_G

IOWRT 0x011
//SER_RSTPD 
APBWRT DAT 0 0x1078 0x00000003 
//DES_RSTPD
APBWRT DAT 0 0x104C 0x00000032

//TXPLL_DIV_1
APBWRT DAT 1 0x0010 0x0140000
//TXPLL_DIV_2
APBWRT DAT 1 0x0014 0x1000000
//SER_CLK_CTRL
APBWRT DAT 0 0x1074 0x0000070
//DES_RXPLL_DIV
APBWRT DAT 0 0x1040 0x0000228

JUMP $Reset_release

$Reset_release

//SER_RSTPD 
APBWRT DAT 0 0x1078 0x00000001
//DES_RSTPD
APBWRT DAT 0 0x104C 0x00000010
IOWRT 0x001
//LRST 
APBWRT DAT 0 0x1068 0x00000D0D 
NOP
//LRST
APBWRT DAT 0 0x1068 0x00000404


JUMP $Rate_Change_Done

$Clock_change_out0_out1

IOWRT 0x081
//PLL_OUT0_AND_OUT1_DIVIDER
APBWRT DAT 0 0x0010 0x08001800

JUMP $Rate_Change_Done

$Clock_change_out2_out3

IOWRT 0x081
//PLL_OUT2_AND_OUT3_DIVIDER
APBWRT DAT 0 0x0014 0x08001800 

JUMP $Rate_Change_Done

$Rate_Change_Done

NOP
NOP

JUMP $Rate_select

HALT"  \
"ACT_CALIBRATIONDATA:true"  \
"APB_AWIDTH:16"  \
"APB_DWIDTH:32"  \
"APB_SDEPTH:2"  \
"APB_TIMEOUT_COUNT:80"  \
"CODEHEXDUMP:"  \
"CODEHEXDUMP2:"  \
"DEBUG:true"  \
"EN_ACM:false"  \
"EN_ADD:true"  \
"EN_ALURAM:false"  \
"EN_AND:true"  \
"EN_CALL:true"  \
"EN_DATAM:2"  \
"EN_INC:true"  \
"EN_INDIRECT:false"  \
"EN_INT:0"  \
"EN_IOREAD:true"  \
"EN_IOWRT:true"  \
"EN_MULT:0"  \
"EN_OR:true"  \
"EN_PUSH:true"  \
"EN_RAM:true"  \
"EN_RAM_ECC:false"  \
"EN_SHL:true"  \
"EN_SHR:true"  \
"EN_XOR:true"  \
"HI_REL:false"  \
"ICWIDTH:8"  \
"IFWIDTH:5"  \
"IIWIDTH:5"  \
"IMEM_APB_ACCESS:0"  \
"INITDATAWIDTH:9"  \
"INITWIDTH:11"  \
"INSMODE:0"  \
"INVALID_STACK_ACC:true"  \
"IOWIDTH:9"  \
"ISRADDR:1"  \
"MAX_NVMDWIDTH:32"  \
"STWIDTH:4"  \
"TESTMODE:0"  \
"UNIQ_STRING:Soft_Processor_Soft_Processor_0"  \
"UNIQ_STRING_LENGTH:31"  \
"VERILOGCODE:"  \
"VERILOGVARS:"  \
"ZRWIDTH:0"   }
# Exporting Component Description of Soft_Processor to TCL done
