• 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. Sending SKILL commands to a running instance of ICFB

Stats

  • Locked Locked
  • Replies 18
  • Subscribers 145
  • Views 29736
  • 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

Sending SKILL commands to a running instance of ICFB

gsimard
gsimard over 16 years ago

Hi all !

 

 I was wondering if it would be possible to send SKILL instructions to a running instance of ICFB, just as if I was typing them in the console of the ICFB, but from an external process. The idea is to use my favorite editor (emacs) and being able to interact with the ICFB process (sending code, retrieving replies, in the best scenario).

 

Thank you for any advice !

Guillaume

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 16 years ago

    Here's an approach I posted to the comp.cad.cadence news group a few years ago.

    There are three parts:

    1. Tcl script skillServer to act as a "server", listening for requests.  

      #!/usr/bin/env tclsh
      # 
      # Author     A.D.Beckett
      # Group      Custom IC, Cadence Design Systems Ltd
      # Machine    SUN
      # Date       Jun 13, 2003 
      # Modified   
      # By         
      # 
      # Simple server interface. Is started by DFII, using ipcBeginProcess(),
      # see skillServer.il.
      # 
      # Opens a server socket, and listens for incoming connections.
      # When data comes in on that incoming connection, it passes it through
      # to DFII (via this process's stdout). Then DFII sends back the result
      # to this process's stdin. The protocol is that the Tcl channel ID is
      # sent as the first word on the data sent to DFII, and also, the channel
      # ID is the first word of the result. This allows us to know where to send
      # the result back to if multiple channels are open
      #
      # the UNIX env var $SKILLSERVPORT defines the port number, and defaults
      # to 8123.
      #
      
      if [info exists env(SKILLSERVPORT)] {
        set port $env(SKILLSERVPORT)
        } else {
        set port 8123
        }
      
      proc listener {channel addr port} {
        puts "$channel abSkillServerConnection(\"$addr\" \"$port\")"
        flush stdout
        fconfigure $channel -buffering line
        fileevent $channel readable [list sendToDFII $channel]
        }
      
      proc sendToDFII {channel} {
        if {[eof $channel] || [catch {gets $channel line}]} {
          # end of file
          close $channel
          } else {
          puts "$channel $line"
          flush stdout
          }
        }
        
      proc sendBack {} {
        gets stdin line
        regsub {^(\w+) .*$} $line {\1} channel
        regsub {^\w+ (.*)$} $line {\1} result
      
        if {![eof $channel]} {
          puts $channel $result
          }
        }
      
      fconfigure stdin -buffering line
      fileevent stdin readable sendBack
      
      socket -server listener $port
      vwait forever
      
    2. SKILL code skillServer.il to launch the skillServer process, and process any output from skillServer as SKILL commands

      abSkillServerDebug=nil
      procedure(abSkillServerConnection(addr port)
          printf("Connection received from address %s, port %s\n" addr port)
          )
      
      procedure(abSkillServerListener(ipcId data)
          let((channel command result)
      	rexCompile("^\\([^ ]*\\) \\(.*\\)$")
      	channel=rexReplace(data "\\1" 1)
      	command=rexReplace(data "\\2" 1)
      	when(abSkillServerDebug
      	    printf("COMMAND: %L\n" command)
      	)
      	unless(errset(result=evalstring(command))
      	    when(abSkillServerDebug
      		printf("ERROR: %L\n" errset.errset)
      	    )
      	    ipcWriteProcess(ipcId sprintf(nil "%s ERROR %L\n" 
      		channel errset.errset))
      	) ; unless
      	when(abSkillServerDebug
      	    printf("RESULT: %L\n" result)
      	)
      	ipcWriteProcess(ipcId sprintf(nil "%s %L\n" channel result))
          )
      )
      
      abSkillServer=ipcBeginProcess("skillServer" "" 'abSkillServerListener)
      
      
    3. Tcl script skillClient to send commands to the Virtuoso session (via skillServer)

      #!/usr/bin/env tclsh
      # 
      # Author     A.D.Beckett
      # Group      Custom IC, Cadence Design Systems Ltd
      # Machine    SUN
      # Date       Jun 13, 2003 
      # Modified   
      # By         
      # 
      # simple command interface which allows me to say
      #
      # skillClient machineName 8123 "skillFunction()"
      #
      
      set hostname [lindex $argv 0]
      set port [lindex $argv 1]
      set command [lindex $argv 2]
      
      set sock [socket $hostname $port]
      puts $sock $command
      
      

    Hopefully this illustrates the idea. Search on google groups under comp.cad.cadence if you want to see some more.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 16 years ago

    Here's an approach I posted to the comp.cad.cadence news group a few years ago.

    There are three parts:

    1. Tcl script skillServer to act as a "server", listening for requests.  

      #!/usr/bin/env tclsh
      # 
      # Author     A.D.Beckett
      # Group      Custom IC, Cadence Design Systems Ltd
      # Machine    SUN
      # Date       Jun 13, 2003 
      # Modified   
      # By         
      # 
      # Simple server interface. Is started by DFII, using ipcBeginProcess(),
      # see skillServer.il.
      # 
      # Opens a server socket, and listens for incoming connections.
      # When data comes in on that incoming connection, it passes it through
      # to DFII (via this process's stdout). Then DFII sends back the result
      # to this process's stdin. The protocol is that the Tcl channel ID is
      # sent as the first word on the data sent to DFII, and also, the channel
      # ID is the first word of the result. This allows us to know where to send
      # the result back to if multiple channels are open
      #
      # the UNIX env var $SKILLSERVPORT defines the port number, and defaults
      # to 8123.
      #
      
      if [info exists env(SKILLSERVPORT)] {
        set port $env(SKILLSERVPORT)
        } else {
        set port 8123
        }
      
      proc listener {channel addr port} {
        puts "$channel abSkillServerConnection(\"$addr\" \"$port\")"
        flush stdout
        fconfigure $channel -buffering line
        fileevent $channel readable [list sendToDFII $channel]
        }
      
      proc sendToDFII {channel} {
        if {[eof $channel] || [catch {gets $channel line}]} {
          # end of file
          close $channel
          } else {
          puts "$channel $line"
          flush stdout
          }
        }
        
      proc sendBack {} {
        gets stdin line
        regsub {^(\w+) .*$} $line {\1} channel
        regsub {^\w+ (.*)$} $line {\1} result
      
        if {![eof $channel]} {
          puts $channel $result
          }
        }
      
      fconfigure stdin -buffering line
      fileevent stdin readable sendBack
      
      socket -server listener $port
      vwait forever
      
    2. SKILL code skillServer.il to launch the skillServer process, and process any output from skillServer as SKILL commands

      abSkillServerDebug=nil
      procedure(abSkillServerConnection(addr port)
          printf("Connection received from address %s, port %s\n" addr port)
          )
      
      procedure(abSkillServerListener(ipcId data)
          let((channel command result)
      	rexCompile("^\\([^ ]*\\) \\(.*\\)$")
      	channel=rexReplace(data "\\1" 1)
      	command=rexReplace(data "\\2" 1)
      	when(abSkillServerDebug
      	    printf("COMMAND: %L\n" command)
      	)
      	unless(errset(result=evalstring(command))
      	    when(abSkillServerDebug
      		printf("ERROR: %L\n" errset.errset)
      	    )
      	    ipcWriteProcess(ipcId sprintf(nil "%s ERROR %L\n" 
      		channel errset.errset))
      	) ; unless
      	when(abSkillServerDebug
      	    printf("RESULT: %L\n" result)
      	)
      	ipcWriteProcess(ipcId sprintf(nil "%s %L\n" channel result))
          )
      )
      
      abSkillServer=ipcBeginProcess("skillServer" "" 'abSkillServerListener)
      
      
    3. Tcl script skillClient to send commands to the Virtuoso session (via skillServer)

      #!/usr/bin/env tclsh
      # 
      # Author     A.D.Beckett
      # Group      Custom IC, Cadence Design Systems Ltd
      # Machine    SUN
      # Date       Jun 13, 2003 
      # Modified   
      # By         
      # 
      # simple command interface which allows me to say
      #
      # skillClient machineName 8123 "skillFunction()"
      #
      
      set hostname [lindex $argv 0]
      set port [lindex $argv 1]
      set command [lindex $argv 2]
      
      set sock [socket $hostname $port]
      puts $sock $command
      
      

    Hopefully this illustrates the idea. Search on google groups under comp.cad.cadence if you want to see some more.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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