Comparsion failure at line 9 on RAM8.hdl

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Comparsion failure at line 9 on RAM8.hdl

William DesLauriers
This post was updated on .
Mark or anybody, I tried to construct a RAM8.hdl. I ran it with the Hardware Simulator. It screeched to stop on line 9 as a comparison failure. What went wrong with the RAM8.hdl? SORRY! Wm
Reply | Threaded
Open this post in threaded view
|

Re: Comparsion failure at line 9 on RAM8.hdl

cadet1620
Administrator
The RAM8.hdl in your post is the supplied version with no implementation. The empty version fails on line 9 which is the first line with non-zero output.

Did you make your RAM8 in a different directory than the RAM8.tst file?

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Comparsion failure at line 9 on RAM8.hdl

William DesLauriers
No. Both (.hdl / .tst) files are in the same directory file area.
Reply | Threaded
Open this post in threaded view
|

Re: Comparsion failure at line 9 on RAM8.hdl

cadet1620
Administrator
OK, but the file you posted does not have anything in its PARTS: section.  If you meant us to look at your file, you need to post it instead of the starter file.

It might be easier if you just mail your RAM8.hdl to me.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Comparsion failure at line 9 on RAM8.hdl

William DesLauriers
Sure!  Just give me a few minutes.  Want my Bit and Register hdl files also?
Reply | Threaded
Open this post in threaded view
|

Re: Comparsion failure at line 9 on RAM8.hdl

cadet1620
Administrator
Can't hurt...
elf
Reply | Threaded
Open this post in threaded view
|

Re: Comparsion failure at line 9 on RAM8.hdl

elf
This post was updated on .
Hi Mark, I have the same problem. Can you share how to solve it?

[Correct solution removed by admin.]

Also, Comparison failure at line 9.
I find out in internal pins, loadB=1, but the outB is still 0. It seems there is something wrong with my Register chip, but I test my Register chip well.
Reply | Threaded
Open this post in threaded view
|

Re: Comparsion failure at line 9 on RAM8.hdl

cadet1620
Administrator
Your RAM8.hdl is correct and passes RAM8.tst on my computer. The problem must be with your Register (or Bit) implementation.

You can debug this by creating a projects/03/a/test directory and copying only RAM8.hdl, .tst, and .cmp files into that directory. That will use the built-in parts for everything else, and it should pass.

Then copy your Register.hdl into the test directory. If RAM8.tst then fails, Register is the problem. If it passes, continue by copying your Bit.hdl.

If you find that either your Register.hdl or Bit.hdl is causing the problem, and it passes its test (copy the .tst and .cmp files into the test directory), please email me the failing HDL. I would like to improve the test(s) to detect the problem.


Please edit your post to remove the correct HDL.

--Mark
elf
Reply | Threaded
Open this post in threaded view
|

Re: Comparsion failure at line 9 on RAM8.hdl

elf
Thank you very much! You provide a good test method.
I test 3 .hdl files in projects/03/a/test separately and they all function well.

I tested in another way:
In Projects/03/a, when Register.hdl is
BUILTIN Bit;
Register test is OK, but RAM8 test failed.

and when I modify it to
Bit(in=in[0],load=load,out=out[0]);
	Bit(in=in[1],load=load,out=out[1]);
        ......
	Bit(in=in[15],load=load,out=out[15]);
in projects/03/a, Register and RAM8 are all OK.

It seems the problem is solved, but could you please explain the reason?? Why can't I use the built-in chip?
Reply | Threaded
Open this post in threaded view
|

Re: Comparsion failure at line 9 on RAM8.hdl

cadet1620
Administrator
I don't know enough about the Hardware Simulator's internals to give a detailed answer.

The BUILTIN keyword is documented in Appendix A as
the HDL body of a built-in chip has the following format:
    BUILTIN Java class name;
where Java class name is the name of the Java class that delivers the chip functionality.
Normally, this class will have the same name as that of the chip, for example
Mux.class. All the built-in chips (compiled Java class files) are stored in a directory
called tools/builtIn, which is a standard part of the simulator’s environment.
It must only be used by itself in an HDL file in a directory that also contains its corresponding Java .class file.

The easiest way to force the Hardware Simulator to use the built-in version of a part instead of YourPart.hdl is to temporarily rename your HDL file.

--Mark