Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I agree with "theFloe". What I want to see is a better/improved AVR simulator because AVR Studio :roll: is not the best tool to work with.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That requires manpower. Volunteers welcome (for simulavr). ;-)

Btw., {commercial plug}VMLAB{/commercial plug} is IMHO a lot better in
its IO simulation features than AVR Studio (and it even runs under the
Wine emulator, unlike AVR Studio... but that's not important for
Winusers).

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This weekend I had a look on simulavr. I ran it with the test_port.bin example and then it asked me for input values for 0x0030... I liked it and though: " Why don't I write a C-Program that captures the ouput and displays I/O changes and feeds the simulater with I/O data". Next i searched the web on how to manage that and found pipes. I wrote a short peace of code and got the output. By now i don't know how to create a read and write pipe. Seems that popen does only open pipes for read OR write access. So i will read about it the next days and keep you informed if i get something running. I want to use the pipes because I don't want to read in the simulavr source and it would so this visualization would be idepended from new releases (if the output does not change completely). Any suggestions?

Hava a look at my web page -> http://www.tobiscorner.at.tf

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, I've split that topic off from Eric's "poll" posting above. It
makes more sense to followup to this discussion in a standard thread,
and leave the poll thread alone.

popen() is not the way to go. It opens a pipe and
simultaneously starts a program to pipe to (or to pipe from).

I could tell you a bit about how to setup a pipe on Unix-like
programming environments, but I'm afraid that's not what you're
looking for (unless you're going to program under Cygwin or such).

Another option might be what Unix calls a FIFO, also called a `named
pipe'. It's an object that exists in the filesystem, so you can refer
to it almost as to a normal file. You start simulavr, redirecting its
stdin from that FIFO:

simulavr ... < /my/fifo

(Substitute /my/fifo for whatever pathname is appropriate for you.)

Then, you pick a second job, and redirect its output to that FIFO (or
you just use fopen() on that FIFO inside that program):

mydatagenerator > /my/fifo

Effectively, both processes will communicate just like if they were on
a pipe. Don't forget to set "mydatagenerator"'s standard output to
line-buffered mode. (While stdout is normally line-buffered by
default when operating on a terminal, it's often switched to
block-buffered when working on a file.)

Sorry, I don't have the faintest idea whether Windows would support
FIFOs in some form, but I hope so.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm working on Linux so the FIFO's should work. For Windows may Cygwin will do the job.
Yeah i read about the FIFO's but it was late and i can't remember all details, but they sound better than pipes with popen. At the moment i'm reading a tutorial about GTK.
So for now i will read and read and read.

Hava a look at my web page -> http://www.tobiscorner.at.tf

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What I'm hoping will happen in the future is that these open source projects (simulavr, avarice) will get ported to use straight Win32 calls on the Windows platform. These projects really need to move away from using Cygwin as it creates all sorts of problems (I've ranted on this before). But again that requires volunteers willing to tackle the issue. Luckily it's being done on avrdude right now.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, actually, that's merely a problem of the environment though, not
of the tools itself: remember, the discussion was about how to feed
simulavr's input data from another program. simulavr just reads from
stdin, so that won't change much by porting it natively to Win32.

In fact, I think simulavr itself probably doesn't need much changes
for native Win32. After all, it's mostly written in standard C, the
only interaction with the outside is done through a socket interface
which is (AFAICT) rather similar in Win32 since they once adopted the
Unix (i. e. BSD) socket interface (at least in theory ;-).

The only system-dependent component is that status monitor running in
an xterm (simulavr-disp). But since it's completely decoupled from
simulavr itself, you just rewrite it completely for Win32. Hmm, OK, I
think the way that separate process is set up is Unix-specific, so you
gotta replace that by this darn spawn_something() Win32 call... (which
does everything like setting up pipes, creating a new process, loading
a new executable, eating up the kitchensink etc. in a single syscall
with a dozen parameters, while Unix uses 6 to 8 staggered calls for it
;-).

It'll probably be a bit more work to port AVaRICE, given that it does
terminal (aka. serial) IO.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dl8dtl wrote:
In fact, I think simulavr itself probably doesn't need much changes for native Win32. After all, it's mostly written in standard C, the
only interaction with the outside is done through a socket interface
which is (AFAICT) rather similar in Win32 since they once adopted the
Unix (i. e. BSD) socket interface (at least in theory ;-).

Agreed. In theory. :roll:

dl8dtl wrote:
The only system-dependent component is that status monitor running in an xterm (simulavr-disp). But since it's completely decoupled from simulavr itself, you just rewrite it completely for Win32.

Just a mere re-write.

dl8dtl wrote:
Hmm, OK, I
think the way that separate process is set up is Unix-specific, so you
gotta replace that by this darn spawn_something() Win32 call... (which
does everything like setting up pipes, creating a new process, loading
a new executable, eating up the kitchensink etc. in a single syscall
with a dozen parameters, while Unix uses 6 to 8 staggered calls for it
;-).

I'm hoping some judicious use of libiberty functions can help in this area.

dl8dtl wrote:
It'll probably be a bit more work to port AVaRICE, given that it does terminal (aka. serial) IO.

And I'm also hoping that perhaps Martin Thomas (who did the avrdude porting) would be willing to help in the serial IO here. :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The last 2 weeks i write a small & simple circuit simulator based on nodal analysis. It's written in JAVA and does support Resistors, Capacitory, DC Volatage & Current Sources.
I tried to implement diodes as well but failed. The problem is that nodal analysis works for linear components. For non linear components you have to build a linear equivalent around it's operating point. The problem is, that you have to guess at the initial operating point. That's the problem. I could only get the diode running, if it's Cathode is connected to Ground.

I started the project in C and switched to JAVA at the time, i needed a structure to hold the values / parameters of each component. Because my pointer knowledge is not as good as it was some years before I switched to Java and build a Class for this. So it should be possible to return to C.

Any suggestions how to bring this together with the simulator.
I could not get the FIFO Stuff running and with JAVA Pipes i had a problem: I got all output data on the Error Stream ..

Hava a look at my web page -> http://www.tobiscorner.at.tf

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So after working on my java spice again, i finished diodes simulation and wrote a small schematic drawing application.
So now i really want to build a AVR co-simulation. But i don't want to program the Simulator myself, because of time.
So i downloaded a new version of simulavr and tested it, the interface has changed a lot from the last time i used it. You can call programs that can display simulation results through pipes. But i can't do this in JAVA. And i cound't find a way to feed the simulator with e.g. imput data.
Maybe o have overseen something. Does anybody, maybe one of the developers, know a way how i could integrate simulavr into my java spice simulator?

Thanks, Tobias

Hava a look at my web page -> http://www.tobiscorner.at.tf

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can see if Avrora meets your needs:
http://compilers.cs.ucla.edu/avr...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you, i'll have a look at that.

Hava a look at my web page -> http://www.tobiscorner.at.tf