• 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. Allegro X PCB Editor
  3. Synchronous Input/output Interprocess Communication , example...

Stats

  • Replies 4
  • Subscribers 160
  • Views 3099
  • Members are here 0
More Content

Synchronous Input/output Interprocess Communication , example does not work

Mhawley1
Mhawley1 over 5 years ago

Don't know if anybody has been using the Cadence Help Document version 02.30-p006 but I cant for the life of get this example working .

There is this section In Cadence Interprocess Communication SKILL Reference where Skill and a C program talk to each other.

They use the example below for the C program and compile it with the name Upper.exe

#include <stdio.h>
#define bufflen 4096
int main(int argc, char* argv[]) 
{
    char buff[bufflen];

    while (1) {
        gets(buff);
        {   int i;
            for(i=0; i < strlen(buff); i++)
                buff[i] = toupper(buff[i]);
        }
        printf(buff);
        fflush(stdio);
    }
}

The SKILL program  is as follows .

cid = ipcBeginProcess( "upper.exe" )
ipcWriteProcess( cid "hello\n" )
x = ipcReadProcess( cid 20 ) 
when(x printf(" New string : %s", x ))
ipcKillProcess( cid ) ;; Kill Or send another string

 

I had to modify the C program so it would even compile . Some of the include libraries were missing and the Flush command didn't look right .

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define bufflen 4096
int main(int argc, char argv[])
{
    char buff[bufflen];

    while (1) {
        gets(buff);
        {   int i;
            for(i=0; i < strlen(buff); i++)
                buff[i] = toupper(buff[i]);
        }
        printf(buff);
        fflush(stdout);
    }
}

The Skill code I modified just a little bit so it pointed exactly to my file and was wrapped in a procedure.

note the directory is just something I made up for example .

procedure(serial_run()
cid = ipcBeginProcess( "G://folder//folder//folder//folder//upper.exe" "" 'myIpcDataHandler 'myIpcErrHandler 'myIpcFinishHandler "/tmp/ipc.log")
ipcWriteProcess( cid "hello\n" )
x = ipcReadProcess( cid 1 )
when(x printf(" New string : %s", x ))
ipcKillProcess( cid ) ;; Kill Or send another string
)

So I get the executable to run once I put in the command serial_run but then it just sits there, no repsonse . If nobody spots any obviouse problems can someone give me the simplest example of Interprocess Communication that works?

  • Sign in to reply
  • Cancel
  • DavidJHutchins
    DavidJHutchins over 5 years ago

    I got your example to work on my Win8.1 laptop with SPB16.6, below is an example session:

    C:\Users\davidh\Documents>cat upper.c
    #include <stdio.h>
    #include <string.h>
    #include <ctype.h>
    #define bufflen 4096
    int main(int argc, char* argv[])
    {
    char buff[bufflen];

    while (1) {
    gets(buff);
    { int i;
    for(i=0; i < strlen(buff); i++)
    buff[i] = toupper(buff[i]);
    }
    printf(buff);
    fflush(stdout);
    }
    }

    C:\Users\davidh\Documents>cat upper.ils
    procedure(serial_run()
    let((cid x)
    (cid = ipcBeginProcess( "C:/Users/davidh/Documents/upper.exe" "" 'myIpcDataHandler 'myIpcErrHandler 'myIpcFinishHandler "C:/temp/ipc.log"))
    ipcWriteProcess(cid "hello\n")
    (x = ipcReadProcess(cid 1))
    when(x printf(" New string : %s\n",x))
    ipcKillProcess(cid) ;; Kill Or send another string
    )
    )

    C:\Users\davidh\Documents>il_allegro
    > sklint(?file "upper.ils")
    Loading skillLint.cxt
    INFO (LoadFile): Loading file D:\Cadence\SPB_16.6\tools\sklint/rules/allegro_sklint.il...
    INFO (LoadFile): Loading file D:\Cadence\SPB_16.6\tools\sklint/rules/dd.il...
    INFO (LoadFile): Loading file D:\Cadence\SPB_16.6\tools\sklint/rules/dm.il...
    INFO (LoadFile): Loading file D:\Cadence\SPB_16.6\tools\sklint/rules/dmBase.il...
    INFO (LoadFile): Loading file D:\Cadence\SPB_16.6\tools\sklint/rules/dmUser.il...
    INFO (LoadFile): Loading file D:\Cadence\SPB_16.6\tools\sklint/rules/hi2ipc.il...
    INFO (LoadFile): Loading file D:\Cadence\SPB_16.6\tools\sklint/rules/ignore.il...
    INFO (LoadFile): Loading file D:\Cadence\SPB_16.6\tools\sklint/rules/ilMig.il...
    INFO (REP008): Program SKILL Lint started on Sep 09 10:35:33 2020.
    INFO (PREFIXES): Using prefixes: "none"
    INFO (STRICT): Using strict checking of global variables.
    INFO (IQ): IQ score is 100 (best is 100).
    INFO (IQ1): IQ score is based on 0 error messages, 0 general warning messages, and 1 top level forms.
    INFO (REP110): Total enhancement : 0.
    INFO (REP110): Total external global : 0.
    INFO (REP110): Total package global : 0.
    INFO (REP110): Total warning global : 0.
    INFO (REP110): Total error global : 0.
    INFO (REP110): Total unused vars : 0.
    INFO (REP110): Total next release : 0.
    INFO (REP110): Total alert : 0.
    INFO (REP110): Total hint : 0.
    INFO (REP110): Total suggestion : 0.
    INFO (REP110): Total internal alert : 0.
    INFO (REP110): Total information : 24.
    INFO (REP110): Total warning : 0.
    INFO (REP110): Total error : 0.
    INFO (REP110): Total internal error : 0.
    INFO (REP110): Total fatal error : 0.
    INFO (REP009): Program SKILL Lint finished on Sep 09 10:35:33 2020 with status PASS.
    t
    > (load "upper.ils")
    t
    > (serial_run)
    New string : HELLO
    t
    > exit

    C:\Users\davidh\Documents>

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Mhawley1
    Mhawley1 over 5 years ago in reply to DavidJHutchins

    Thank you David for testing it

    I did find out what the problem was eventually  ! There was nothing wrong with the code the whole time . I found out that if you put the Executable on a drive letter ( a company one ) far far away it cannot acces it in time . I guess it timed out .

    With that baby step done . I can now pass in large masses or strings for manipulation ….

    * backstory* I want to make a silkscreen generator . BRD file passes Silkscreen and part extent data to C program . C program spits out "ideal" Silkscreen position data …

    No idea what kind of algorithm would do that , but should be fun figuring it out . Smiley

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • DavidJHutchins
    DavidJHutchins over 5 years ago in reply to Mhawley1

    When I worked at Intel as a CAD Engineer I found that using the full UNC pathnames was better than using the mapped drive names in the tools I developed for them...

    Is your C program going to include pad & via locations, since silkscreen on exposed copper creates solder reflow issues ( so I was told in a previous life... )?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Mhawley1
    Mhawley1 over 4 years ago in reply to DavidJHutchins

    I should have responded to this sooner , I didn't think of that but your right I would need to report those geometries as well . Then I thought of another problem , sometimes you just cant fit the whole group of test and you need to put it off somewhere else in the board with a leader line . ( think I saw that done on my xbox motherboard once) 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

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