Retargeting Ptolemy Galaxies

  • Ptolemy 0.6 retargeting patch
  • Ptolemy Home Page

  • octredomain

    octredomain is a new octtools binary that will redomain a facet. When used in conjuction with ptfixtree, it is possible to retarget hierarchies of galaxies.
    1. The Ptolemy 0.6 retargeting patch adds src/octtools/octredomain to the tree, and modifies bin/ptfixtree. To install octredomain, you must have downloaded the Ptolemy other.src tar file, see The Ptolemy 0.6 Distribution Page
      1. Download the patch
      2. cd $PTOLEMY
      3. Install the patch with:patch -p1 < patch
      4. Create obj.$PTARCH: cd $PTOLEMY; csh -f MAKEARCH
      5. Install the octredomain binary: cd $PTOLEMY/obj.$PTARCH/octtools/octredomain make -f make.template makefile make install
    2. octredomain takes a domain argument and changes the domain of a facet. This was fairly straight forward, I just copied src/octtools/octls/octls.c and stripped out a lot of code :-)

      The guts of the code are:

      OH_ASSERT(octInitGenContents(&facet, OCT_INSTANCE_MASK, &gen)); OH_ASSERT(ohGetByPropName( &facet, ¶mProp, "domain")); printf ("Changing from %s\n",paramProp.contents.prop.value.string); OH_ASSERT(ohCreateOrModifyPropStr(&facet,¶mProp,"domain",newDomainName)); octFreeGenerator( &gen ); OH_ASSERT(octCloseFacet(&facet)); return 0; } To use octredomain: cxh@watson 521% cp -r $PTOLEMY/src/domains/sdf/demo/butterfly /tmp cxh@watson 522% octredomain -d CGC /tmp/butterfly Changing from SDF cxh@watson 523%
    3. I modified ptclfixtree.ptcl so that ptclfixtree takes a -d option which indicates what domain to retarget to.

    Retargeting sdf/sinMod

    How I retargetted sdf/sinMod, which uses sdf/singen and sdf/modulator
    1. Since we are changing the galaxies, we need to copy the original facet and the singen and modulator galaxies: cp -r $PTOLEMY/src/domains/sdf/demo/sinMod . cp -r $PTOLEMY/src/domains/sdf/demo/singen . cp -r $PTOLEMY/src/domains/sdf/demo/modulator .
    2. Then use masters on a copy of the sinMod universe so we use our singen and modulator galaxies:. masters sinMod modulator uses singen too, so we run on it and replace singen: masters modulator
    3. Run the ptfixtree on sinMod and retarget to CGC: ptfixtree -d CGC sinMod
    4. Start up ptrim sinMod, and run the demo. In the development tree, I get an error message: Error: default-CGC: Unknown scheduler But if I type a 'T' to bring up edit-target and change the Looping Level from: ACYLOOP #choices are: DEF, CLUST, SJS, ACYLOOP to 0 and then run the universe again, a CGC binary is produced and run!

    Not all domains have all stars

    Originally, I tried to retarget the sdf/freqPhase demo, but it uses FIRCx star, which does not exist in CGC. The error message was: Adding $PTOLEMY/src/domains/sdf/dsp/icons -> $PTOLEMY/src/domains/cgc/dsp/icons /users/cxh/pt/src/octtools/octredomain/phaseShift:schematic:contents: $PTOLEMY/src/domains/sdf/dsp/icons/FIRCx: --> $PTOLEMY/src/domains/cgc/dsp/icons/FIRCx ********* octfix failed *********** failed on: /users/cxh/pt/src/octtools/octredomain/phaseShift:schematic:contents: $PTOLEMY/src/domains/sdf/dsp/icons/FIRCx: --> $PTOLEMY/src/domains/cgc/dsp/icons/FIRCx /users/cxh/pt/bin.sol2/octfix: fatal error detected by octfix (code 1): New path $PTOLEMY/src/domains/cgc/dsp/icons/FIRCx is not valid

    Open Bugs

    1. What if we have a multi-domain universe, and we only want to change galaxies that are in domain A to domain B, but not change galaxies in domain C or D? We could modify octredomain so that it takes an 'old domain' argument and the domain of the facet must match the old domain or it won't be changed.
    2. We really need a tool that will extract all the demo facets necessary for a universe. We could use ptfixtree here. We might also want to be able to grab all the demo and icon facets too.

      ptfixtree -list facetname will print all the facets in a universe.

      The following command will print all the subgalaxies that are not built in.

      ptfixtree -list $PTOLEMY/src/domains/sdf/demo/sinMod | \ grep demo | grep -v contains | sort | sort -u

    cxh@eecs.berkeley.edu