Quantcast
Channel: Altera Forums
Viewing all 19390 articles
Browse latest View live

Accessing SDRAM memory on Terasic DE0-Nano board.

$
0
0
I want to use SDRAM memory located on DE0-Nano board using Verilog (without using Nios).
I use http://www.altera.com/support/exampl...avalon-mm.html

System placed in the QSYS:
qsys.jpg
sdram_write not currently used.

Code:
Code:

//=======================================================

module SRAM(
CLOCK_50, LED,
DRAM_ADDR, DRAM_BA, DRAM_CAS_N, DRAM_CKE, DRAM_CLK, DRAM_CS_N, DRAM_DQ, DRAM_DQM, DRAM_RAS_N, DRAM_WE_N //Memory pin
);

//////////// CLOCK //////////
input                          CLOCK_50;

//////////// LED //////////
output            [7:0]        LED;
//reg                [7:0]        LED;

//////////// SDRAM //////////
output            [12:0]        DRAM_ADDR;
output            [1:0]        DRAM_BA;
output                          DRAM_CAS_N;
output                          DRAM_CKE;
output                          DRAM_CLK;
output                          DRAM_CS_N;
inout            [15:0]        DRAM_DQ;
output            [1:0]        DRAM_DQM;
output                          DRAM_RAS_N;
output                          DRAM_WE_N;

//////////// AVALON MASTER TEMPLATE //////////
wire        qsys_sdram_read_control_fixed_location;
wire        [31:0] qsys_sdram_read_control_read_base;
wire        [31:0] qsys_sdram_read_control_read_length;
wire        qsys_sdram_read_control_go;
reg        reg_qsys_sdram_read_control_fixed_location;
reg        [31:0] reg_qsys_sdram_read_control_read_base;
reg        [31:0] reg_qsys_sdram_read_control_read_length;
reg        reg_qsys_sdram_read_control_go;
wire        qsys_sdram_read_control_done;
wire        qsys_sdram_read_control_early_done;
wire        qsys_sdram_read_user_read_buffer;
reg        reg_qsys_sdram_read_user_read_buffer;
wire        [15:0] qsys_sdram_read_user_buffer_output_data;
wire        qsys_sdram_read_user_data_available;

reg gooff=0;
reg rboff=0;
reg init=1;

qsys u0(
        .clk_clk(CLOCK_50),                                //clk.clk
        .reset_reset_n(1'b1),                            //reset.reset_n
       
        .sdram_clock_c0_clk(DRAM_CLK),                //sdram_clock_c0.clk
        .sdram_clock_areset_conduit_export(1'b0),    //sdram_clock_areset_conduit.export
       
        .sdram_wire_addr(DRAM_ADDR),                    //sdram_wire.addr
        .sdram_wire_ba(DRAM_BA),                        //          .ba
        .sdram_wire_cas_n(DRAM_CAS_N),                //          .cas_n
        .sdram_wire_cke(DRAM_CKE),                        //          .cke
        .sdram_wire_cs_n(DRAM_CS_N),                    //          .cs_n
        .sdram_wire_dq(DRAM_DQ),                        //          .dq
        .sdram_wire_dqm(DRAM_DQM),                        //          .dqm
        .sdram_wire_ras_n(DRAM_RAS_N),                //          .ras_n
        .sdram_wire_we_n(DRAM_WE_N),                    //          .we_n
       
        .sdram_read_control_fixed_location(qsys_sdram_read_control_fixed_location),
        .sdram_read_control_read_base(qsys_sdram_read_control_read_base),
        .sdram_read_control_read_length(qsys_sdram_read_control_read_length),
        .sdram_read_control_go(qsys_sdram_read_control_go),
        .sdram_read_control_done(qsys_sdram_read_control_done),
        .sdram_read_control_early_done(qsys_sdram_read_control_early_done),
        .sdram_read_user_read_buffer(qsys_sdram_read_user_read_buffer),
        .sdram_read_user_buffer_output_data(qsys_sdram_read_user_buffer_output_data),
        .sdram_read_user_data_available(qsys_sdram_read_user_data_available)
);

assign qsys_sdram_read_control_fixed_location = reg_qsys_sdram_read_control_fixed_location;
assign qsys_sdram_read_control_read_base [31:0] = reg_qsys_sdram_read_control_read_base [31:0];
assign qsys_sdram_read_control_read_length [31:0] = reg_qsys_sdram_read_control_read_length [31:0];
assign qsys_sdram_read_control_go = reg_qsys_sdram_read_control_go;
assign qsys_sdram_read_user_read_buffer = reg_qsys_sdram_read_user_read_buffer;

always @(posedge CLOCK_50)
begin
    if (gooff)
    begin
        gooff <= 0;
        reg_qsys_sdram_read_control_go <= 0;
    end
   
    if (init)
    begin
        reg_qsys_sdram_read_control_fixed_location <= 0;
        reg_qsys_sdram_read_control_read_base <= 0;
        reg_qsys_sdram_read_control_read_length <= 8;
        reg_qsys_sdram_read_control_go <= 1;
        gooff <= 1;
        init <= 0;
    end
   
end

assign LED [7:0] = qsys_sdram_read_user_buffer_output_data [7:0];

endmodule




Memory is not written so it should read garbage and display on the LEDs, but the LEDs do not light.
Attached Images

Problem with Printf

$
0
0
I ve written a simple C-program running on Nios with output on JTAG-Uart Console.

Why if the surce code is


int m;
m=9;
printf("%d",m);

everthing works perfectly while if the source code is modified in:

int m;
m=10;
printf("%d",m);

it does not work anymore ???

Installing Altera software 13.0.1 - Stuck at "Installing Quartus II Help"

modelsim altera 10.1 nativelinke error

$
0
0
Each time i try and run modelsim from tools->run simulation tool->rtl simulation i get a nativelink error.
Error: Cant launch the modelsim-altera software -- the path to the location of the executable for the modelsim-altera software were not specified or the executable were not found at the specified path.

if i go to tools->options->eda tool options under modelsim-altera the correct file path is there "c:\altera\13.1\modelsim_ase\win32aloem\" and if i got into that folder the modelsim.exe is there and i can launch the program from that exe.
Under assignments->settings->eda tool settings->simulation the tool name selected is modelsim-altera.

any help fixing this error would be greatly appreciated thanks.

configuring SPI on SOPC

$
0
0
hello, I am trying to configure DE2 board as a Master and connect device(s) to it via SPI.
DE2 -------> Device(s)

In SOPC, do I include "SPI (3 wire serial)" from the library or "Avalon-ST Serial Peripheral Interface"?

Also do I need to use the expansion headers (GPIO0, GPIO1) and connect MISO,MOSI,SS,SCK to any pins? Because I don't see a SPI port on DE2 board.

I just need to know how to configure SPI and which pins to use to connect to device(s).

Lastly, are there any example C codes for sending/receiving data via SPI?

Thank you very much

Nios II development board connection

$
0
0
Hi,

I am New to EP2s60f672c3 Nios II development stratix II development kit. I connected power supply and USB blaster to device and Host computer. While programming getting message "Installation of JTAG server as windows server failed" and I am not able to proceed with the work. They are asking for server name while trying to add "currently using hardware".. Please note I did Device point to point connection with Host computer not connected to LAN.

Please Tel me what are the steps that I need to solve problem.

Thankyou...

quartus II subscription edition trial

$
0
0
Hi,

How I am able to get Quartus II subscription edition 30 trial version with programming file support??? Is it possible? I am don't wish to buy a paid version now.
please replay

Thank you

Changing PLL settings without a new compilation

$
0
0
Hi,
I am using Arria V GX FPGA and Quartus 13.1 and there are timing violations, so I need to try different PLL settings to try to fix them. Is there a way to change the PLL phase shift for example, without changing it in Megawizard and running a complete compilation? I tried in the Resource Property Editor but all the fields are greyed out and can't be edited. Or is it possible to run only a new timing analysis for another phase shift?
Thanks.

int c = a

$
0
0
I search information about this instruction : int c = a <? b;

A sample of code who compiled with an older version of nios2-elf-gcc (NIOS II EDS 6.0) :

Code:

int foo(int a, int b)
{
  int c = a <? b;
  ...
}

an operator ?
a digrah ?
what is it ?

what compiler options to use with nios2-elf-gcc (NIOS II EDS 13.1) ?

Thanks

Nios SPI and alt_u32 bit array

$
0
0
Hello guys. I have a little doubt.. Hope someone could help me..

I'm using the standard altera function to tx and rx on a SPI.

The proto is:

Code:

int alt_avalon_spi_command(alt_u32 base, alt_u32 slave, alt_u32 write_length, const alt_u8* wdata, alt_u32 read_length, alt_u8* read_data, alt_u32 flags)
So if i want to transmit the array:
uint32_t my_array[32]={.....};

I would call:
alt_avalon_spi_command(SPI_BASE, 0, 32, my_array, 0, NULL,0);

By the way, as you see, the function alt_avalon_spi_command wants a 8-bit unsigned pointer. So how can I figure out if I want to transmit a 32bit unsignet variable at a time ?

Intuitively I would do something like that:
alt_avalon_spi_command(SPI_BASE, 0, 32*4, (uint8_t*)my_array, 0, NULL,0);

What do you recommend ?

altlvds_tx with manual delay chain ?

$
0
0
I have been trying to setup an LVDS output where I can control the delay chain. ie: I want to output at 1GHz with manual phase control.

Since I want to run the output at 1GHz, I am using the altlvds_tx to drive the output signal. So far so good. Now I connect it to an altiobuf in differential mode. Still no problem.

Now, I enable the altiobuf option "Enable output buffer dynamic delay chain1". When I try to synthesize, quartus says:
Error (21199): LVDSOUT port of LVDS DPA atom "arriav_serdes_dpa1" must be fed by output pin that does not feed any other logic

Looking in the code quartus generates in the db/ folder, I see that indeed the lvds serdes is fed through a dpa component. I do not need or want dynamic phase alignment. I want to explicitly control the delay chain buffer. I tried directly instantiating arriav_ir_fifo_userdes, but quartus refuses to let me connect it without feeding the signals through an arriav_serdes_dpa.

How can I convince quartus to run the serdes blindly and let me control the delay chain?

PS. I know I can also achieve phase control by shifting a PLL, but that gets me at most 1GHz/8=125ps granularity whereas the delay chain approach offers 50ps.

Switch to shadow register set

$
0
0
Hi, all!

I can not switch to shadow register set. I am trying to do this in my main() function, outside any interrupt handler. I am using directions from the "Changing Register Sets" section of the Nios II Processor Reference Handbook (here is a link).

Directions are:
If the processor is currently running in the normal register set, insert the new register set number in estatus.CRS, and execute eret.

Here is my code, placed in the main() (project is created from Hello world template):
Code:

        // prologue
        asm("addi  sp,sp,-8");
        asm("stw  r16,0(sp)");
        asm("stw  r17,4(sp)");
        // estatus.CRS = 1
        asm("movhi  r16,0xffff");
        asm("ori    r16,r16,0x03ff");
        asm("rdctl  r17,status");
        asm("and    r17,r17,r16");
        asm("ori    r17,r17,0x0400");
        asm("wrctl  estatus,r17");
        // switch
        asm("eret");                    // <------- processor hangs here

        // wrap
        asm("ldw  r16,0(sp)");
        asm("ldw  r17,4(sp)");
        asm("addi  sp,sp,8");

The problem is that processor hangs on eret because ea - register with the return address - points to eret itself.

I tried to change ea manually with something like addi ea,ea,8, but this does not help. Is there any way to properly adjust the ea before eret? Is it possible to change a register set in the main?

I would appreciate any help or advice.

With regards,
Olga

Cyclone V SerialLite-II

$
0
0
Hello all,

I am trying to impement SerialLite-II on a Cyclone V. I have my design to the point where I can simulate it successfully, but synthesis fails with the following error:

Warning: OUTCLK port on the PLL is not properly connected on instance main_pll:u_main_pll|main_pll_0002:main_pll_inst|al tera_pll:altera_pll_i|general[0].gpll. The output clock port on the PLL must be connected.
Info: Must be connected
Error: HSSI PMA TX Buffer node 'impl_top:dut|sl2_top:u_sl2_top|xcvr_phy:u_xcvr_ph y|altera_xcvr_custom:xcvr_phy_inst|av_xcvr_custom_ nr:A5|av_xcvr_custom_native:transceiver_core|av_xc vr_native:gen.av_xcvr_native_insts[0].gen_bonded_group.av_xcvr_native_inst|av_pma:inst_ av_pma|av_tx_pma:av_tx_pma|av_tx_pma_ch:tx_pma_ins ts[0].av_tx_pma_ch_inst|tx_pma_ch.tx_pma_buf.tx_pma_buf ' is not properly connected on the 'DATAOUT' port. It must be connected to one of the valid ports listed below.
Info: Can be connected to I port of arriav_io_obuf WYSIWYG
Error: HSSI PMA RX Buffer node 'impl_top:dut|sl2_top:u_sl2_top|xcvr_phy:u_xcvr_ph y|altera_xcvr_custom:xcvr_phy_inst|av_xcvr_custom_ nr:A5|av_xcvr_custom_native:transceiver_core|av_xc vr_native:gen.av_xcvr_native_insts[0].gen_bonded_group.av_xcvr_native_inst|av_pma:inst_ av_pma|av_rx_pma:av_rx_pma|rx_pmas[0].rx_pma.rx_pma_buf' is not properly connected on the 'DATAIN' port. It must be connected to one of the valid ports listed below.
Info: Can be connected to O port of arriav_io_ibuf WYSIWYG
Info: Can be disconnected


Altera changed the way the core is created with the V-series and separated the PHY from the core in the megawizard. This may add more flexibility in the design, but certainly adds more complexity (and room for error) in the connections between the blocks. I particularly enjoyed the reference in the error to ArriaV...

Has anyone out there been successful with their SerialLite implementation on Cyclone V? Any insights?

Thanks in advance!

Switch to shadow register set - ea problem

$
0
0
Hi, all!


I can not switch to shadow register set. I am trying to do this in my main() function, outside any interrupt handler. I am using directions from the "Changing Register Sets" section of the Nios II Processor Reference Handbook (here is a link).


Directions are:
If the processor is currently running in the normal register set, insert the new register set number in estatus.CRS, and execute eret.


Here is my code, placed in the main() (project is created from Hello world template):
Code:

        // prologue
        asm("addi  sp,sp,-8");
        asm("stw  r16,0(sp)");
        asm("stw  r17,4(sp)");
        // estatus.CRS = 1
        asm("movhi  r16,0xffff");
        asm("ori    r16,r16,0x03ff");
        asm("rdctl  r17,status");
        asm("and    r17,r17,r16");
        asm("ori    r17,r17,0x0400");
        asm("wrctl  estatus,r17");
      // switch
        asm("eret");                    // <------- processor hangs here
        // wrap
        asm("ldw  r16,0(sp)");
        asm("ldw  r17,4(sp)");
        asm("addi  sp,sp,8");


The problem is that processor hangs on eret because ea - register with the return address - points to eret itself.


I tried to change ea manually with something like addi ea,ea,8, but this does not help. Is there any way to properly adjust the ea before eret? And is it possible to change a register set in the main?


I would appreciate any help or advice.


With regards,
Olga

Is Quartus capacitive loading setting add real capacitance to FPGA pins?

$
0
0
The setting locates in Quartus [Assignments]-->[Settings]-->[Device]-->[Device and Pin Options]-->[Capacitive Loading tab]. At first I took it as only a value specified for timing analysis, but lately I read a white paper Minimizing Ground Bounce & VCCSag, it talked about ways to eliminate ground bounce and VCC sag. There is a method:
Programmable GND or VCC on every third I/O pin. Programmable GNDs and VCC s are not connected to board GND or VCC and have a 7.5-pF load.
And then I was wondering does it relate to the Capacitive Loading setting?
And another point might support Capacitive Loading add real capacitance is that the setting specifies same value to pins of the same I/O standard.
I am now confused.

not able to connect to altera website

$
0
0
Hi

I downloaded Quartus II subscription edition version 10.1 from site. To get license I need t click " pERFORM AUTOMATIC LICENSE RETRIEVAL". but I am not able to do that. getting a error message that "can't connect to altera, check your browser setting like that. please note that I am using latest internet explore version. Then what will be the problem? Please Help me

thank you

Altera Cyclone II DSP development board EP2C70F672C6

$
0
0
we are interfacing the cmos camera (c3038) with Altera Cyclone II DSP development board (EP2C70F672C6).
we required to interface memory [ssram(cy7c1360b) , ddr2sdram(MT4HTF3264AY)] , i2c protocol, vga controller etc... if anyone has these components file or the .exe file of Altera cyclone ii dsp development board then please send us.:(
Attached Files

How to carryout the data from one module to other module within the project

$
0
0
i am trying adc in verilog coding . i have problem in the taking the data value from top level entity to the sub coding lcd . but i cant carried the data which i have seen in led .

Help,Problem with DDR2 HPCII simulation

$
0
0
I have a design using DDR2 HPCII controller(with Altmemphy) in Cylone IV.When I simulate the this HPCII controller with Micron 1Gb DDR2 simulation model,strange things happened:1)when simulating the example design,block read and block write is ok.2)when simulating only block write with my design ,simulation is ok.3)when simulating only block read with my design,simulation is ok.4)when simulting first block write(1024DW) and when block read(1024DW) with my design,write is ok,but nothing can be read out. In the error situation, I find all read requests have been sent to DDR2 HPCII controller,but HPCII didn't send request signals on AFI interfaces. Can anybody tell me why? Are there some contraints in using DDR2 HPCII controller?? By the way,local_init_done signals is high already.

synthesizable VHDL subset

$
0
0
Call me an idealistic noob, but it does not seems that Altera provides any description of the VHDL subset which can be synthesizable by its tools, and this bothers me a lot.

Still pass the VHDL standard does not address this issue, but as a tool provider why does Altera not seem to bother to define this?

Does anyone shares my feelings?

And where could I found this so precious information???
Viewing all 19390 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>