Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12600 Discussions

Simulating Nios II in ModelSim - problems with memtest

Altera_Forum
Honored Contributor II
1,069 Views

Folks, 

 

I've managed to get the Nios II simulating in ModelSim per AN 351 with the Hello World example app. Now I'm trying to get the example memory test app to run and I'm running into problems. 

 

First, the interactive terminal doesn't accept user input from the keyboard. Anybody run into that?  

 

I created a new function in memtest.c that removes the user input and just attempts to run the tests on the external flash.  

 

strcpy(flashname, EXT_FLASH_NAME); fd = alt_flash_open_dev(flashname); 

 

However, the alt_flash_open_dev() function returns an error: 

 

ERROR: Could not open /dev/ext_flash 

 

I'm not sure what I'm missing here. Anyone have any pointers? 

 

I'm using Quartus II v.10.1, Nios2EDS v.10.1. 

 

 

Thanks.
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
343 Views

I don't think a model of any type is generated for the flash device. You'd have to provide one yourself (perhaps, from the manufacturer). 

 

Cheers, 

 

slacker
0 Kudos
Altera_Forum
Honored Contributor II
343 Views

There is a testbench model for the external flash in the reference design I'm using.

0 Kudos
Altera_Forum
Honored Contributor II
343 Views

Interesting. So the jtag_uart module apparently loads input values from a .dat file in the sim directory: 

 

Embedded Peripherals IP User Guide: 

Simulated Input Character Stream You can enter a character stream that will be simulated entering the read FIFO upon simulated system reset. The MegaWizard Interface accepts an arbitrary character string, which is later incorporated into the test bench. After reset, this character string is pre-initialized in the read FIFO, giving the appearance that an external JTAG terminal program is sending a character stream to the JTAG UART core.  

 

So does that mean the simulation model will not accept input from the keyboard?  

 

If the contents of the .dat file is read in after reset, you can't really simulate the user inputs to the queries by the memory test software.
0 Kudos
Reply