Lattice bug?
10 messages in this thread
I've been playing around with the new Lattice compiler, which I just received,
and I've noticed what seems to be a peculiar bug with LC, the 2-pass compiler
command. When using the -a option I get the following message:
lc -ad prog.c
option conflict. -b option ignored
Has anyone else noticed this problem? I could get around the problem by
executing both passes separately, but I'd rather not do that. Is this a bug,
or am I off base here?
– brent
New version as in 4.0? (sorry can't answer your question, but I am curious as
to your version…) –Ben–
Brent,
I also noticed the same thing. It seems like a 'bug' to me, as the -b
option shouldn't be active. I don't think it causes a problem, though, since
the module that you're compiling to go to chip memory doesn't want to use the
relative-data addressing mode anyways. I've not found a real problem with
stuff compiled this way – works like it should. It's just that the compiler
seems to put out an extra 'warning' level message. I'd call it a cosmetic bug
– don't worry about it (unless reality proves otherwise).
..Bob
Brent:
I noticed that warning message in LC too, but like Bob I haven't seen that
it caused a problem yet.
Something that is more of a nuisance that I don't recall seeing in 3.10 is
that if I compile modules with different -a directives and then try to link
them, Blink complains about unmerged data segments or something like that and
won't link the modules. E.g. I had a main module with data that had to be in
chip memory, and compiled it -ad, and compiled the other modules with no -a
option because the data did not have to be in chip memory. Did not have to do
this with 3.10 and the older version of blink.
Anyone know of a better way to handle this than recompiling all the modules
the with -ad?
Regards,
…Mark…
Mark:
If you peruse the docs, you'll notice that it mentions that unlike
3.10, the -b option is defaulted to ON. This means that the compiler is by
default in base-register addressing mode. Try recompiling all the "non-a"
modules with the -b0 option, which disables this type of addressing. BTW, as
you've probably gathered from the other messages in this thread, if you specify
either LC's -a option or LC2's -c option, the implicit -b option is ignored by
the compiler.
Good luck,
Ariel
Ariel:
Docs?? You mean the readme file that I glanced at briefly before I couldn't
restrain myself from playing? I shall have to go back and study it more
carefully.
I guess that shipping 4.0 with the same manual as 3.10 made things easier,
faster, and cheaper, but any rank newcomers to the compiler are going to be
utterly confused. Such is life. It was nice of Lattice to ship a couple of
goodies like ConMan with the package tho – I knew ConMan existed, but I had
never taken the time to find it and now I regret every CLI command I ever had
to retype.
Thanks for the info,
…Mark…
Look again. The manual shipped with 4.0, while similar to the 3.10 manual, is
DIFFERENT. I have found it very lacking in some areas (like the assembler),
but it is a new manual. Sure, they kept the same format and style as the
previous one, but look a little closer. (I now get confused when I pick up the
manual, cause I keep the two versions together and am constantly looking at the
wrong one.)
..Bob
Mark:
It may LOOK like the same manual, but it isn't by a long shot. Look
again. The manual seems to have been rewritten for 4.0.
Ariel
Brent:
As I mentioned to Mark, this is not a bug. If you take a closer look
at the docs, you'll notice that the -b option (which was OFF by default in
3.10) is now defaulted to ON. When you try to compile something with the -ad
option, you are apparently giving the compiler contradictory requests, that is,
to put my data hunk in CHIP and also reference it from my code with a 16-bit
offset (+ – 32K).
It could also be that in -b mode the compiler wants to reference ALL of
the data (BSS/BSU) from a single address register, and can't do that with one
set in CHIP and one defaulted to FAST.
Whatever the actual problem is, you can disable the error indication by
using the -b0 option.
Good luck,
Ariel
Thanks, Ariel, I think you are right. I had read about the -b option
now being the default, but I'd forgotten about it. If you forget
that you're compiling with that option, and you get the -b warning message, it
certainly does look strange. All in all, though, I really enjoy the new
compiler. John Toebes and Lattice have done a good job.
– brent