# Exporting Component Description of COREABC_C0 to TCL
# Family: PolarFire
# Part Number: MPF300TS-1FCG1152I
# Create and Configure the core component COREABC_C0
create_and_configure_core -core_vlnv Actel:DirectCore:COREABC:$COREABCver -component_name {COREABC_C0} -params {\
"ABCCODE:    
$WelcomeMessage
    
    //reset deassertion 
    IOWRT DAT 0x0

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    NOP
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'E'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'n'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'Y'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'u'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'C'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'h'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'c'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e' 

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 '1'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 46
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'D'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'v'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'c'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'S'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'   
  
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'a'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'l'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'N'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'u'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'm'   
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'b'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'
    
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 '2'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 46
    
    
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'U'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'c'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'd'   
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 '3'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 46
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'F'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'a'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'b'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'c'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'D'   
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'g'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    
    Jump $UARTINPUT
    
$UARTINPUT
    
    WAIT UNTIL INPUT2
    APBREAD 1 0x4
    APBWRT ACC 1 0x0 
    CMP DAT 0x31
    Jump IF Zero $Pattern1 
    CMP DAT 0x32
    Jump IF Zero $Pattern2
    CMP DAT 0x33
    Jump IF Zero $Pattern3
    Jump $WelcomeMessage

$RESETINPUT
    
    WAIT UNTIL INPUT2
    APBREAD 1 0x4
    APBWRT ACC 1 0x0 
    CMP DAT 0x31
    Jump IF Zero $Devicereset 
    CMP DAT 0x32
    Jump IF Zero $Designreset
    Jump $WelcomeMessage

$Devicereset
    IOWRT DAT 0x2

$Designreset
    IOWRT DAT 0x1


$Pattern3

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'D'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'g'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'


    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'C'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'h'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'c'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'k'


    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'S'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'a'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'u'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 0x3A

//Reading DIGEST RESPONSE 

    //wait until USER_BUSY is zero - there is an inversion at CoreABC input
    WAIT UNTIL INPUT1
    
    //load the command register with the command code
    APBWRT DAT16 2 0x04 0x47
    
    //load the command associated data
    //load the MBX_WCNT register with number of words
    APBWRT DAT16 2 0x14 0x1
    
    //write the user data into mail box
    //Digest check options - 0x4 is for sNVM digest check
    APBWRT DAT16 2 0x28 0x5

    //set the request bit in SYS_SERV_REQ register to start the service   
    APBWRT DAT16 2 0x0C 0x1    

    // Wait until USER_BUSY is zero - there is an inversion at CoreABC input
    WAIT UNTIL INPUT1

    
    NOP
    NOP
    NOP
    NOP
    NOP
    NOP

    //WAIT UNTIL INPUT0
    //APBWRT DAT8 1 0x0 'E'
    //WAIT UNTIL INPUT0
    //APBWRT DAT8 1 0x0 'X'
    //WAIT UNTIL INPUT0
    //APBWRT DAT8 1 0x0 'I'
    //WAIT UNTIL INPUT0
    //APBWRT DAT8 1 0x0 'T'
    //WAIT UNTIL INPUT0
    //APBWRT DAT8 1 0x0 'E'
    //WAIT UNTIL INPUT0
    //APBWRT DAT8 1 0x0 'D'

    //WAIT UNTIL INPUT0
    //APBWRT DAT8 1 0x0 10
    //WAIT UNTIL INPUT0
    //APBWRT DAT8 1 0x0 13
    
    //Read status returned by system controller
    APBREAD 2 0x08

    //Write the status to SERV_RESPONSE register
    APBWRT ACC 0 0x1010

//print SERV_RESPONSE on uart  
    NOP
    NOP

    APBREAD 0 0x2020
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    //Take user input on device reset
    //Print that LSRAM content is not retained after Fabric Digest Check

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 '*'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'L'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'S'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'R'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'A'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'M'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'C'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'n'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'n'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'n'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'a'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'n'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'd'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'a'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'f'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'F'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'a'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'b'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'c'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'D'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'g'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'C'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'h'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'c'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'k'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 '*'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'E'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'n'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'Y'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'u'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'C'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'h'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'c'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'f'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'R'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 ':'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 '1'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 46
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'D'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'v'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'c'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'R'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'   
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 '2'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 46

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'D'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'  
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'g'  
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'n'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'R'   
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13

    jump $RESETINPUT
        

$Pattern2
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'U'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'c'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'd'   
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 0x3A

//Reading Usercode or Silicon Signature
    
    // wait until USER_BUSY is zero - there is an inversion at CoreABC input
    WAIT UNTIL INPUT1

    //load the command register with the command code
    APBWRT DAT16 2 0x04 0x01

    //load the command associated data
    //load the MBX_RCNT register with number of words
    APBWRT DAT8 2 0x18 0x01
    
    //load the Mailbox Read Address Descriptor
    APBWRT DAT8 2 0x20 0x0

    //set the request bit in SYS_SERV_REQ register to start the service 
    APBWRT DAT8 2 0x0C 0x1 
    
    //wait until USR_RDVLD 
    WAIT UNTIL INPUT3

    //Read Mailbox read data
    APBREAD 2 0x2C

    //Write the received data to buffer for binay to hex conversion 
    APBWRT ACC 0 0x1014
    
//print the USERCODE on uart  

    APBREAD 0 0x2028
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x2026
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x2024
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    
    APBREAD 0 0x2022
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    Jump $WelcomeMessage    
    
$Pattern1
      
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'D'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'S'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'N'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'v'   
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'a'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'l'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'u'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 0x3A
    
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    
//Reading DSN 
    //wait until USER_BUSY is zero - there is an inversion at CoreABC input
    WAIT UNTIL INPUT1
    
    APBWRT DAT16 2 0x04 0x00
    APBWRT DAT8 2 0x18 0x04
    APBWRT DAT8 2 0x20 0x0
    APBWRT DAT8 2 0x0C 0x1 
    
    WAIT UNTIL INPUT3
    APBREAD 2 0x2C
    APBWRT ACC 0 0x1000
    
    WAIT UNTIL INPUT3
    APBREAD 2 0x2C
    APBWRT ACC 0 0x1004
    
    WAIT UNTIL INPUT3
    APBREAD 2 0x2C
    APBWRT ACC 0 0x1008

    WAIT UNTIL INPUT3
    APBREAD 2 0x2C
    APBWRT ACC 0 0x100C  

//print DSN_VALUE on uart  
    
    APBREAD 0 0x201E
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    
    APBREAD 0 0x201C
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    
    APBREAD 0 0x201A
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x2018
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x2016
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x2014
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x2012
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x2010
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x200E
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x200C
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x200A
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x2008
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x2006
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x2004
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x2002
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x2000
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

Jump $WelcomeMessage    

HALT 
    
    "  \
"ACT_CALIBRATIONDATA:true"  \
"APB_AWIDTH:16"  \
"APB_DWIDTH:32"  \
"APB_SDEPTH:16"  \
"APB_TIMEOUT_COUNT:80"  \
"CODEHEXDUMP:"  \
"CODEHEXDUMP2:"  \
"DEBUG:true"  \
"EN_ACM:false"  \
"EN_ADD:true"  \
"EN_ALURAM:false"  \
"EN_AND:true"  \
"EN_CALL:false"  \
"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:false"  \
"EN_RAM:false"  \
"EN_RAM_ECC:false"  \
"EN_SHL:true"  \
"EN_SHR:true"  \
"EN_XOR:true"  \
"HI_REL:false"  \
"ICWIDTH:11"  \
"IFWIDTH:4"  \
"IIWIDTH:4"  \
"IMEM_APB_ACCESS:0"  \
"INITDATAWIDTH:32"  \
"INITWIDTH:11"  \
"INSMODE:0"  \
"INVALID_STACK_ACC:true"  \
"IOWIDTH:2"  \
"ISRADDR:1"  \
"MAX_NVMDWIDTH:32"  \
"STWIDTH:8"  \
"TESTMODE:0"  \
"UNIQ_STRING:COREABC_C0_COREABC_C0_0"  \
"UNIQ_STRING_LENGTH:23"  \
"VERILOGCODE:"  \
"VERILOGVARS:"  \
"ZRWIDTH:0"   }
# Exporting Component Description of COREABC_C0 to TCL done
