• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Got a SYNTAX ERROR, does anyone meet this error?

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 10693
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Got a SYNTAX ERROR, does anyone meet this error?

lingtao jiang
lingtao jiang over 3 years ago

I use python script to load ocn file and skill script. Here is the ocean script:

setup(?numberNotation 'engineering)

simulator( 'spectre )
design( "/home/IC/simulation/LNA_test/spectre/schematic/netlist/netlist")
resultsDir( "/home/IC/simulation/LNA_test/spectre/schematic" )
modelFile(
'("/home/IC/Tech/TSMC-65nm(OA)/tsmcN65/../models/spectre/toplevel.scs" "tt_lib")
)
analysis('dc ?saveOppoint t )
analysis('ac ?start "10k" ?stop "1G" )
envOption(
'analysisOrder list("dc" "ac")
)
temp( 27 )

Then I got this in the terminal: SYNTAX ERROR found at line 1 column 39 of file *string*
*Error* lineread/read: syntax error encountered in input

Does anyone meet this error before?Could you give me some help?

  • Cancel
Parents
  • lingtao jiang
    lingtao jiang over 3 years ago

    And here is the skill script:

    procedure( loadSimulator(runDir loadFile popSize)
    ; Change he running directory
    cd(runDir)

    ; Load the simulator
    load(loadFile)

    ; Set an environment variable with the number of evaluations per simulation
    ; run. At the begin, it is the population size.
    setShellEnvVar("SMOC_NUM_EVALS" popSize)

    msg = "loadSimulator_OK"
    )

    procedure( updateAndRun(runFile varFile resultFile numSim)
    ; Update the circuit design variables
    load(varFile)

    ; Get the number of evaluations of the previous run
    numEvals = getShellEnvVar("SMOC_NUM_EVALS")
    numEvals = atoi(numEvals) ; Convert to integer

    ; Disable or enable the number of evaluations per required
    if( numSim < numEvals then
    for( i (numSim + 1) numEvals
    sprintf(testName "test:%d" i)
    ocnxlDisableTest(testName)
    )
    else
    if( numSim > numEvals then
    for( i (numEvals + 1) numSim
    sprintf(testName "test:%d" i)
    ocnxlEnableTest(testName)
    )
    )
    )

    ; Update the env variable with the current number of evaluations
    sprintf(numSimStr "%d" numSim) ; Convert to string
    setShellEnvVar("SMOC_NUM_EVALS" numSimStr)

    ; Set the results file
    setShellEnvVar(resultFile)

    ; run the simulation
    load(runFile)

    msg = "updateAndRun_OK"
    )

    procedure( sendData(cid msg)
    printf("[INFO] Sending message to server: %s\n" msg)
    ; First sends the size of the data to send
    ipcWriteProcess(cid sprintf(nil "%d\n" strlen(msg)))
    ; Then sends the data
    ipcWriteProcess(cid msg)
    )

    procedure( requestHandler(cid request)
    let( (result resultStr)
    if( serverHasStarted <= 0 then
    if( request == "Python server has started!" then
    serverHasStarted = 1
    printf("[INFO] Cadence is talking to server! Waiting for a client connection...\n")
    else
    printf("[INFO] Waiting for server... Message: %s\n" request)
    )
    else ; if server has started
    ; if the request is to call a function
    if( rexMatchp("(.*)" request) then
    ; The "errsetstring" evaluates the request and returns the result,
    ; if valid, or an error message. E.g. if the request is a function,
    ; it executes the function and returns the result.
    if( result = errsetstring(request 't) then
    sprintf(resultStr "%L\n" car(result))
    else
    sprintf(resultStr "%s\n" car(nthelem(5 errset.errset)))
    )
    sendData(cid resultStr)
    else ; if the request is a message, prints that message
    printf("[INFOs] %s\n" request)
    )
    )
    )
    )

    procedure( errorHandler(cid errorMessage)
    warn("%s\n" errorMessage)
    )

    procedure( exitHandler(cid exitStatus)
    printf("Server has stopped with the exit code %d. I'm out!!!\n" exitStatus)
    ocnxlEndXLMode() ; End XL mode
    hiRegTimer("exit()", 10) ; exit Cadence
    )

    procedure( startServer()
    printf("[INFO] Starting server process...\n")
    serverHasStarted = 0
    cid = ipcBeginProcess("sh run_server.sh" "" 'requestHandler 'errorHandler 'exitHandler "")
    msg = "Python server has started!\n"
    ipcWriteProcess(cid sprintf(nil "%d\n" strlen(msg)))
    ipcWriteProcess(cid msg)
    )

    serverHasStarted = 0
    ; Starts the server
    startServer()

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to lingtao jiang

    There's not really enough to go on here - there's no column 39 in line 1 of either file, but since the error seems to be coming from reading a string, my guess is that the error is being triggered by the errsetstring() in the requestHandler function, and so presumably is in the string being sent to it by whatever "run_server.sh" is doing.

    For example, if I do something like this:

    > errsetstring("6+7+" t)

    6+7+
        ^
    SYNTAX ERROR found at line 1 column 5 of file *string*
    *Error* lineread/read: syntax error encountered in input

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to lingtao jiang

    There's not really enough to go on here - there's no column 39 in line 1 of either file, but since the error seems to be coming from reading a string, my guess is that the error is being triggered by the errsetstring() in the requestHandler function, and so presumably is in the string being sent to it by whatever "run_server.sh" is doing.

    For example, if I do something like this:

    > errsetstring("6+7+" t)

    6+7+
        ^
    SYNTAX ERROR found at line 1 column 5 of file *string*
    *Error* lineread/read: syntax error encountered in input

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • lingtao jiang
    lingtao jiang over 3 years ago in reply to Andrew Beckett

    Hello Andrew,

    Thank you so much for helping me. I will try to find the error.

    Regards,

    Lingtao

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information