04-15-2005, 04:22 AM
Hey, I'm here on business. Can anyone send some links my way on simulating clocked CPU cycles at more than 1000 cycles a second (e.g. threads) ?
I have a final design project for one of my CmpE courses, in which I'm writing an simulator for a silly little amigobot used in the course, powered by a 1Mhz single-register computer we wrote in VHDL and programmed into an Altera Flex board. This, along with a BIOS diagnostic for the robot, has been sucking up 16 hours day.
Now, what I have done, with javascript being my most knowledgable langauge, is written a simulator for the robot, that compiles assembly code into a virtual memory dump, interprets the bytecode, and simulates the I/O ports. There's an incomplete implementation here:
http://www.betterwebber.com/stuff/AlteraSim.zip
The problem with this (in progress) javascript implementation, however, is that the fastest this thing can ever go is 1000Hz, and that's like super-ideal because Javascript can only thread in milliseconds time (looping locks up the parent browser). I still want to finish it because it's 100% cross platform, but, well, you know, when this thing gets into sonar and IR simulation, it's going to take a hit in speed.
So, this is my chance to finally explore Freebasic and make a complementary port, so I can develop a full-speed simulator side by side. But from my knowledge, Win32 threads also execute at 1ms. How do emulators and virtual machines for 3mHz computers execute like this? My knowledge of event based programming has been cuddled under virtual languages like javascript and java until now. With a 1mHz clock, this thing needs to be able to perform 333,000 instructions per second, without clogging up Windows, to be full speed. Does anyone have experience with this?
I'm thinking, and only guess, that I'd have to make a single thread, and figure out if Windows has some sort of microsecond timer or something.
I have a final design project for one of my CmpE courses, in which I'm writing an simulator for a silly little amigobot used in the course, powered by a 1Mhz single-register computer we wrote in VHDL and programmed into an Altera Flex board. This, along with a BIOS diagnostic for the robot, has been sucking up 16 hours day.
Now, what I have done, with javascript being my most knowledgable langauge, is written a simulator for the robot, that compiles assembly code into a virtual memory dump, interprets the bytecode, and simulates the I/O ports. There's an incomplete implementation here:
http://www.betterwebber.com/stuff/AlteraSim.zip
The problem with this (in progress) javascript implementation, however, is that the fastest this thing can ever go is 1000Hz, and that's like super-ideal because Javascript can only thread in milliseconds time (looping locks up the parent browser). I still want to finish it because it's 100% cross platform, but, well, you know, when this thing gets into sonar and IR simulation, it's going to take a hit in speed.
So, this is my chance to finally explore Freebasic and make a complementary port, so I can develop a full-speed simulator side by side. But from my knowledge, Win32 threads also execute at 1ms. How do emulators and virtual machines for 3mHz computers execute like this? My knowledge of event based programming has been cuddled under virtual languages like javascript and java until now. With a 1mHz clock, this thing needs to be able to perform 333,000 instructions per second, without clogging up Windows, to be full speed. Does anyone have experience with this?
I'm thinking, and only guess, that I'd have to make a single thread, and figure out if Windows has some sort of microsecond timer or something.