Simulation of MicroBlaze embedded system

Is there a guide to behaviorally simulating a MB embedded system? I have gotten as far as compiling the libraries, running simgen, instatiating the system in a top_level, and writing a testfixture for that top level. It all loads correctly in NC-Sim, and I am able to look at all signals within the system. I am able to validate that the dcm is working as it should. It gets the input clock from the testfixture and outputs the multiplied/divided frequency that it should.

Our system has a Xilinx GPIO connected to a simple USB chip (FTDI). When a signal from the USB chip goes low, the microblaze code starts the process of reading the data from the chip. I thought I had that working even though I was blindly writing timing in the testfixture without knowledge of where the MicroBlaze processor was or when things should occur. It really isn't working...in the sim at least.

Is there a way to know what code the MicroBlaze is running at a particular time? There are MANY signals available to look at in regards to MB. There doesn't seem to be any documentation explaining how to do this. It all kind of leaves off after getting everything compiled.

When do I know that the MicroBlaze has finished all the intitialization code that is written? Will I have to actually analyze the number of cycles used and insert that timing in the testfixture? It seems like there should be an easier way to do this.

Eventually, I would like to get to the point of running timing sims to see where our problems lie. We get weird results after different builds when we change a signal or two on a debug port we are pulling out from our modules. Sometimes things totally hose up!

Thanks.

Reply to
motty
Loading thread data ...

The XUPV2P Using Base System Builder Quickstart

formatting link
has an example modelsim do file that displays the Microblaze program counter and MSR.

Use mb-objdump to associate the program counter values with actual assembly instructions from the source code.

Paul

motty wrote:

Reply to
Paul Hartke

Hy motty, the way to know what exactly the processor does during the simulation is to use the "mb-objdump" tool as Paul mentioned above. the PC (program counter) register is located under the microblaze0 instance and is called "PC_EXE[31:0]" find it and put it to your sim waves. use the mb-objdump tool to relate the PC values to the actual code (c + assembler). another tip is to compile using the -g option (debug) . I hope it helps, Mordehay.

Reply to
me_2003

Thanks all! Is there a way to dump the output of the mb-objdump to a file? It lists in the command console and it would be nice to have a hard-copy.

Reply to
motty

Use console redirection: mb-objdump -Sx executable.elf >

executable.objdump

motty wrote:

Reply to
Paul Hartke

Super! Thanks alot! Now I can make some good progress....

Reply to
motty

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.