From: Doug Evans <dje@sebabeach.org>
To: Dave Korn <dave.korn.cygwin@googlemail.com>,
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: cgen <cgen@sources.redhat.com>
Subject: Re: cgen->sim question
Date: Mon, 26 Oct 2009 16:13:00 -0000 [thread overview]
Message-ID: <4AE5CA87.5030500@sebabeach.org> (raw)
In-Reply-To: <4AE59913.5040402@gmail.com>
Dave Korn wrote:
> Dmitry Eremin-Solenikov wrote:
>
>> Hello,
>>
>> I have a question regarding generating sim code from cgen description.
>>
>> I have an instruction operand instantiated from field with type h-addr.
>> If in the semantics part of the instruction I try to access the operandr
>> as an address: '(mem QI ddaddr)', I get an error from cgen:
>>
>> simplify.inc:131:3: op:new-mode: invalid mode for operand `ddaddr': USI
>>
>> This is the definition of ddaddr:
>>
>> (dif f-dd-1 "1-byte direct address at 1 position" (ABS-ADDR) 8 8 0 8 UINT #f #f)
>> (dno ddaddr "direct address" () h-addr f-dd-1)
>>
>>
>
> I've seen this too. I made it go away by changing the hardware element type
> in the define-normal-operand from h-addr to h-uint (or h-sint in some cases).
> I don't know for a fact if it was the right thing to do, but all the
> generated code ended up looking sane; it does leave me a little unsure,
> however, because now I don't know what h-addr is actually supposed to be used
> for - my port ends up not using it at all anywhere, and everything appears to
> work.
>
Huh. I tried it and it worked ok.
(dni dmitry-test "dmitry's h-addr issue"
()
"dmitry $ddaddr"
(+ OP1_7 OP1_1 ddaddr)
(set (mem QI ddaddr) 0)
()
)
The generated code for a basic simulator has:
i_ddaddr = f_dd_1;
{
QI opval = 0;
SETMEMQI (current_cpu, pc, i_ddaddr, opval);
TRACE_RESULT (current_cpu, abuf, "memory", 'x', opval);
}
What does the instruction definition look like?
next prev parent reply other threads:[~2009-10-26 16:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-26 10:45 Dmitry Eremin-Solenikov
2009-10-26 12:26 ` Dave Korn
2009-10-26 16:13 ` Doug Evans [this message]
2009-10-26 20:13 ` Dmitry Eremin-Solenikov
2009-10-27 7:39 ` Doug Evans
2009-10-28 16:40 ` Doug Evans
2009-10-30 21:59 ` Dmitry Eremin-Solenikov
2009-10-27 18:06 ` Dave Korn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AE5CA87.5030500@sebabeach.org \
--to=dje@sebabeach.org \
--cc=cgen@sources.redhat.com \
--cc=dave.korn.cygwin@googlemail.com \
--cc=dbaryshkov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).