473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 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 3435
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 also to a floppy. I have foreseen a potential...
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 target can stop the program. What do I need to do?
5
by: Jeong-Gun Lee | last post by:
I'm writing a code of writing a value to a specific memory address. ================================================================= #include <stdio.h> int main() { long air; long...
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 customized hardware. I could use python to communicate...
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 store the data in a file. 50 to 100 bytes every 5 or...
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 store the data in a file. 50 to 100 bytes every 5 or...
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 (all other data in that file should remain...
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 overwrite or ">>" to append. And then use that...
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. My question: According to the various books and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.