( ESNUG 238 Item 4 ) ---------------------------------------------- [4/4/96]
From: ellement@sdd.hp.com (David Ellement)
Subject: (ESNUG 237 #4) Bum 2-D Arrays & Using "alias" To Mimic Functions
Hello John,
I overlooked an important detail in the two dimensional array example I sent
in ESNUG 237 #4 -- strong variable typing in Design Compiler. To correct this
find the two places in my script where:
_name = _period = _rising_edge = _skew = ""
and replace them with:
_name = ""
_period = _rising_edge = _skew = - 1.0
Sorry for the mistake!
Also, when I asked about emulating functions in dc_shell (ESNUG 237 #4), I've
used aliases for that purpose, except that it seemed necessary to use global
variables to pass parameters. (I suppose what I what I'm looking for is a
way to avoid the use of global variables.) Here's an example alias:
We've been using a set of generic scripts to synthesize our design (which
allows for some variation in synthesis process such as adding block specific
constraints by including block specific scripts if they exist.) IMPORTANT:
To avoid generating superfluous error messages, we wanted to test for the
*existence* of the specific scripts, before trying to "include" them.
With 'block_name' set to the block name, the test for the block timing
constraint script looked like this:
_file = block_name + "_timing.scr"
find_file
if (dc_shell_status == 0) { /* 'sh' exit code '0' when successful */
block_timing_script = _file
} else {
echo "Warning: missing script: " + _file
block_timing_script = ""
}
Since this same test is applied for different files, the test part has been
setup as an alias (find_file):
alias find_file "_test = \"\";\
foreach (_dir, search_path) { \
_test = _test + \"test -f \" + _dir + \"/\" + _file + \" || \"; \
}; \
sh _test + \"false\"" /* exit code `0' when successful */
This works, but what I'd really like is to define a function "find_file" that
would be applied:
block_timing_script = find_file (block_name + "_timing.scr")
As it stands now, I expect that I'll get bit by '_file' defined in mutiple
scripts when I don't want it defined.
- David Ellement
Hewlett Packard
|
|