I guess I should rephrase this question to this:
What's the best way to expose a new function to be used in the *.sm SLICC
files?

On Fri, May 6, 2011 at 3:26 AM, Korey Sewell <ksew...@umich.edu> wrote:

> Hi all,
> I'm trying to drop in warn/inform/panic/dprintf/etc messages into the SLICC
> files because these functions are pretty invaluable to the being able to
> validate, debug and document what's going on in your simulation, but  I have
> not been able to get them to work inside a SLICC .sm file.
>
> I was hoping that I could place a "base/misc.hh" header file somewhere and
> magic would ensue but that was not the case :)
>
> Instead, it looks like I would have to add my own detection functions for
> warn/inform/etc. in the SLICC parser, so that when I call those functions in
> the code, it will recognize it.
>
> I am wondering if anyone has had a similar problem like this (in terms of
> adding random C++ code to a *.sm file) and if so can you give me your
> perspective on what I would need to do get this working in SLICC. Is this
> functionality already there in SLICC and I'm just missing something?
>
> The current error I receive is this:
> Exception: MOESI_CMP_directory-L2cache.sm:973: Error: Unrecognized function
> name: 'warn':
>   File "/y/ksewell/m5-dev/m5-outgoing/SConstruct", line 1025:
> ...
>   File "/y/ksewell/m5-dev/m5-incoming/src/mem/slicc/ast/AST.py", line 50:
>     self.location.error(message, *args)
>   File "/y/ksewell/m5-dev/m5-incoming/src/mem/slicc/util.py", line 72:
>     raise Exception, "%s: Error: %s" % (self, message)
>
>
> I think this is pretty high utility, so if it's not going to be a
> "programming adventure", I'd like to go ahead and spend time to get it
> working. If anyone has any thoughts or suggestions, please let me know what
> you think.
>
> Thanks.
>
> --
> - Korey
>



-- 
- Korey
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to