472,342 Members | 1,327 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,342 software developers and data experts.

Writing Hardware Simulators?

Hello All,

I'll be writing a hardware simulator for one of our CPU's shortly.
Any advices/links/... on the subject?

Thanks.
Miki
Jul 18 '05 #1
7 3363
Miki Tebeka wrote:

I'll be writing a hardware simulator for one of our CPU's shortly.
Any advices/links/... on the subject?


No links I'm aware of, although you can easily find an HC11 simulator
out there somewhere.

Kaval has written but not yet released (okay, not even completed) an
HC12 simulator (independent of the above effort).

Performance is roughly 1/60 of the actual CPU speed running at the
nominal clock speed (16MHz), when the code is run on the simulator
on a PC of about 600MHz.

If performance is not your greatest concern (which presumably it isn't
or you wouldn't consider Python in the first place :-), you shouldn't
have much difficulty...

Advice? Write *lots* of tests. In fact, write dozens (literally!)
of test cases for each opcode.

Make sure you have a clear idea of your priorities and don't try to
implement more than you really need, to begin with. I didn't need
anything involving simulating the actual instruction cycle times
(i.e. simulating time was not important yet), and I haven't gotten
to the point where I care much about simulating hardware peripherals
such as the serial port. I'm just doing the basic CPU and opcodes,
and obviously memory. As a result of this narrow focus, it took
only a few weeks to produce an effective, usable simulator, although
I still have a few opcodes to complete. (Even the opcodes I'm
implementing only as I have code that requires them. I suggest
implementing an UnimplementedOpcode exception for *all* opcodes,
then running your code. Only implement the actual opcodes as you
need them...)

-Peter
Jul 18 '05 #2
I'll be writing a hardware simulator for one of our CPU's shortly.
Any advices/links/... on the subject?


Have you googled the newsgroup?
http://groups.google.com/groups?hl=e...mp.lang.python

'hardware simulator' returns 22 hits, including your post

For the web in general, 'Python hardware simulator' gets 17000 hits so
you might want to narrow the search.

TJR
Jul 18 '05 #3
I take it that this is an instruction set simulator (ISS) rather than an
RTL level simulator?

Miki Tebeka wrote:
Hello All,

I'll be writing a hardware simulator for one of our CPU's shortly.
Any advices/links/... on the subject?

Thanks.
Miki


Jul 18 '05 #4
Hello Donald,
I take it that this is an instruction set simulator (ISS) rather than an
RTL level simulator?

Not so sure about the difference (RTL = Real Time Logic?).
It should simulate the CPU and some peripherials as well.
Currently I can ignore the pipline and some other stuff.

Thanks.
Miki
Jul 18 '05 #5
Hello Terry,
http://groups.google.com/groups?hl=e...mp.lang.python

'hardware simulator' returns 22 hits, including your post I know. None of them is much use (including mine :-)
For the web in general, 'Python hardware simulator' gets 17000 hits so
you might want to narrow the search.

Thats what I'm working on now.

Thanks
Miki
Jul 18 '05 #6
te****@cs.bgu.ac.il (Miki Tebeka) writes:
Hello All,

I'll be writing a hardware simulator for one of our CPU's shortly.
Any advices/links/... on the subject?

Thanks.
Miki


Miki, I do not know if this is what you are looking for?

"""
MyHDL is a Python package for using Python as a hardware description
and verification language.
"""

<http://jandecaluwe.com/Tools/MyHDL/Overview.html>

Thomas
Jul 18 '05 #7
Miki Tebeka wrote:
Hello Donald,

I take it that this is an instruction set simulator (ISS) rather than an
RTL level simulator?


Not so sure about the difference (RTL = Real Time Logic?).
It should simulate the CPU and some peripherials as well.
Currently I can ignore the pipline and some other stuff.


RTL = Register Transfer Level. This is a hardware description style
that models transfers between registers. In practice, it is often
used to refer to "synthesizable" hardware models, that is, models
that can be converted to a gate implementation automatically.

If you need to model hardware, it may be easier when you have a
light-weight model for deterministic concurrency. This is what
so-called "hardware description languages" (HDLs) provide. I wrote
a package that turns Python into an HDL, using generators:

http://jandecaluwe.com/Tools/MyHDL/Overview.html

There is a one-week old mailing list:

http://sourceforge.net/mail/?group_id=91207

with a nntp gateway though gmane:

nntp://news.gmane.org/gmane.comp.python.myhdl

Nick Patavalis has just posted an example CPU simulator
to this mailing list, so you may want to check it out.

Regards, Jan

--
Jan Decaluwe - Resources bvba - http://jandecaluwe.com
Losbergenlaan 16, B-3010 Leuven, Belgium
Bored with EDA the way it is? Check this:
http://jandecaluwe.com/Tools/MyHDL/Overview.html

Jul 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

48
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and...
18
by: Mad Programmer | last post by:
I'm writing a destructive trojan with C++ and I need to know how I can destroy the target's monitor and format the target's harddisk before the...
5
by: Jeong-Gun Lee | last post by:
I'm writing a code of writing a value to a specific memory address. ================================================================= #include...
13
by: jay.dow | last post by:
I want to write to the pins of an RS232 without using the serial protocol. The use would be every pin could act to complete a circuit in...
7
by: John Pote | last post by:
Hello, help/advice appreciated. Background: I am writing some web scripts in python to receive small amounts of data from remote sensors and...
4
by: John Pote | last post by:
Hello, help/advice appreciated. Background: I am writing some web scripts in python to receive small amounts of data from remote sensors and...
16
by: Claudio Grondi | last post by:
I have a 250 Gbyte file (occupies the whole hard drive space) and want to change only eight bytes in this file at a given offset of appr. 200 Gbyte...
3
by: Studentmadhura05 | last post by:
Hi, I am trying to simply write the results of my grep etc to a file. According to what I read in books, I need to open the ouput file with ">" to...
30
by: Cramer | last post by:
I've finally gotton board with TDD (test driven development) and wow is it effective! I went from sceptic to True Believer with my first effort. ...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.