Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

microblaze simulation whit isim or modelsim

Status
Not open for further replies.

moein0114

Newbie level 6
Joined
Jul 1, 2015
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
92
hi . i designed some thing and i am using microblaze on my project .
every thing is ok , but i want to simulate my whole project with isim , but i dont know why its not working right . actually i am getting any output .
i used xps for creating microblaze and used sdk for my c++ code and after that i have no idea what to do for simulate this project .

can any body help me >?
 

You might be better off creating a microblaze bus functional model that connects to the bus interfaces like AXI4 or whatnot. Running a simulation with the microblaze running C++ code might result in excessively long simulations. Your lack of output may just be a result of it not reaching the C++ code that does whatever algorithm you've got running on your microblaze.

Without a testbench and any transcript of the simulation output and a "its not working right" problem description, it's difficult to make any other suggestions.
 

tnx you for your help . i think my problem is it that the isim is not considering my code in sdk .
actually i think in isim there is a microblaze but its not defined what is it doing ?
do you any idea what should i do to make isim to understand my microblaze ???
 

If I recall correctly the simulation model of the microblaze should have a line in it somewhere that includes reading a .MIF or some other memory file that has the binary image of the code generated from the SDK. The corresponding instruction memory needs to have that file loaded. If you have any warnings from the isim transcript you should look at them and make sure it's not reporting a missing file.

If you have the instruction memory initialized with the code the mircroblaze should start running in the simulation. Of course the last time I tried this was with Modelsim not ISIM.
 

i just checked my project folder . there is no .mif file . so how did you simulate microblaze with modelsim ?
 

I can say in general how a C/C++ code can be made to run on a uP in SIMULATION.

What you need to have in place:
1> A top-level test-bench which instantiates the uP design. This test-bench should also have the ability to read from a *.hex or some other memory file. This is similar to the uP reading from an external ROM and executing what it has to.
This is similar to what ads-ee has mentioned - "If I recall correctly the simulation model of the microblaze should have a line in it somewhere that includes reading a .MIF or some other memory file that has the binary image of the code generated from the SDK. The corresponding instruction memory needs to have that file loaded."

2> The creation of the *.hex/.mif/memory file.
In this case you need to use the tool-chains provided by the FPGA vendor. You compiler your C/C++ code, intermediate object files are created and finally you should create a *.hex/binary/memory file.

Depending on how you have created your test-bench, after launching your simulation GUI, run it for some milli-sec and you should be able to see the functionality described in your C code in the Transcript window (some print messages perhaps).

See you have first understand the flow, what needs to be done for a uP to execute a piece of code written in some high-level language. Once this is done it is just a matter of finding out what tools are at your disposal to get the thing done.
 
tnx for your help . i have seen some tutorial , as i understood i should have some thing from my sdk project , and that is .elf file , and then i need to add this elf file to my project . i did this , and steel the output of my simulation is 0 , i dont know why its not working at all .
 

I'm not sure how you added the .elf file to your project, but I doubt the simulator knows about the elf file.

As I said before you're going to have to go into the RTL code (unless you can find a Microblaze simulation tutorial) of the Microblaze and find where it loads the memory used as the instruction memory and find the initialization of that memory for simulation purposes. If it's in Verilog it would be some sort of $readmem line in the code that references the memory array of a block ram.

I'm basing this off of the simulations that were done using an embedded PPC405 in a Virtex 4, to run the simulation model of the processor we had to initialize the instruction memory. Attempted it just once and it took so long to just boot the processor and start executing main that we abandoned it in favor of a BFM of the processor subsystem that just responded/generated transactions on the interfaces (memory/plb). Never actually tried this with a microblaze as I immediately wrote a BFM of the processor for HDL simulations.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top