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

Interrupt subroutine with NIOS II processor through UART

$
0
0
Hi,

I am trying to use NIOS PROCESSOR with some subroutines. Programing the NIOS, i am using ALTERA ECLIPSE. Is there any c code for reference to access nios through interrupts.???


Thanxinadvance,
Kd

Kindly post the performance numbers of any OpenCl kernel or DNN net on GPU vs altera

$
0
0
Hello All,

If anybody is interested in performance numbers and have comparison between
running any OpenCl kernel or DNN net on GPU vs altera.




Thank you.

Interfaces and Synthesis

$
0
0
I am trying to use interfaces for use in abstraction and simplification of port connections. Something structs cannot do very well because they cannot carry information about direction. However, I cannot quite understand how an 'interface' interfaces to a top level file's ports.

Here is an example of some code I was testing with to try understanding interfaces.
Code:

// Interface definition
interface EMIF_Bus;
  input    logic  [1:0] EMIF_addr;
  output  logic  [15:0] EMIF_data;
  input    logic  EMIF_readEnable;
endinterface

// Top level
module interface_top (
  input    clk,
  input    reset,
  EMIF_Bus chip_io
);

// Instantiating lower module
interface_sv SYSTEMVERILOG_DUT
(
  .clk        (clk),
  .reset      (reset),
  .module_io  (chip_io)
);

The following is an example of a dummy top level file for a quartus project. The submodule will assign an appropriate output depending upon address and read, but the important part is that this is synthesize without errors and through the technology map viewer I can verify it would function. The issue I did not expect is the dozens of warnings for permanently forcing tristate buffers as inputs or outputs. My understanding is that the declaration of "input" or "output" in the interface should remove the underlying notion of "inout" that is default for an signal that would not have a direction. However, the warnings would indicate that these port connections are being treated as "inout" rather than simply output or input.

Therefore, I am trying to clarify my misunderstanding of interfaces.

Compiling the OpenCL Hello World example

$
0
0
Hi,

I am trying to compile the OpenCL Hello World program that came with Nallatech on Windows 10 with OpenCL v18.0, but I am having problems :(. I have a 395AB board and when I issue the compile command, it returns that QSYS Failed and to check the log. The command I used is what was illustrated on the Nallatech documentation:

aoc -v -board=p395_hpc_ab hello_world.cl -seed=1

The program, hello_world.cl, is very simple:

// AOC kernel demonstrating device-side printf call
__kernel void hello_world(int thread_id_from_which_to_print_message) {
// Get index of the work item
unsigned thread_id = get_global_id(0);

if(thread_id == thread_id_from_which_to_print_message) {
printf("Thread #%u: Hello from Altera's OpenCL Compiler!\n", thread_id);
}
}

Here is the output from aoc:

aoc -v -board=p395_hpc_ab hello_world.cl -seed=1

aoc: Environment checks are completed successfully.
aoc: Cached files in C:\Users\RM\AppData\Local\aocl may be used to reduce compilation time
You are now compiling the full flow!!
aoc: Selected target board p395_hpc_ab
aoc: Running OpenCL parser....
aoc: OpenCL parser completed successfully.
aoc: Optimizing and doing static analysis of code...
aoc: Linking with IP library ...
Checking if memory usage is larger than 100%
aoc: First stage compilation completed successfully.
Compiling for FPGA. This process may take a long time, please be patient.
Error: Qsys-script FAILED.
Refer to hello_world/hello_world.log for details.

Checking the log reveals the following. The log is attached...

...
2018.06.01.15:49:01 Info: add_connection board.kernel_clk2x kernel_system.clock_reset2x
2018.06.01.15:49:01 Error: add_connection board.kernel_clk2x kernel_system.clock_reset2x: No interface named board.kernel_clk2x.
2018.06.01.15:49:01 Info: add_connection board.kernel_reset kernel_system.clock_reset_reset
2018.06.01.15:49:01 Info: add_connection kernel_system.kernel_mem0 board.kernel_mem0
2018.06.01.15:49:01 Info: add_connection kernel_system.kernel_mem1 board.kernel_mem1
2018.06.01.15:49:01 Info: add_connection kernel_system.kernel_mem2 board.kernel_mem2
2018.06.01.15:49:01 Info: add_connection kernel_system.kernel_mem3 board.kernel_mem3
2018.06.01.15:49:01 Info: add_connection board.kernel_irq kernel_system.kernel_irq
2018.06.01.15:49:01 Error: add_connection board.kernel_irq kernel_system.kernel_irq: No interface named board.kernel_irq.
2018.06.01.15:49:01 Info: add_connection board.kernel_cra kernel_system.kernel_cra
2018.06.01.15:49:01 Error: add_connection board.kernel_cra kernel_system.kernel_cra: No interface named board.kernel_cra.
2018.06.01.15:49:01 Info: add_connection board.acl_internal_snoop kernel_system.cc_snoop
2018.06.01.15:49:01 Error: add_connection board.acl_internal_snoop kernel_system.cc_snoop: No interface named board.acl_internal_snoop.
2018.06.01.15:49:01 Info: add_connection board.kernel_clk kernel_system.cc_snoop_clk
2018.06.01.15:49:01 Info: save_system

Why am I getting these errors?

Thanks,

QG
Attached Files

SignalTap over Avalon?

$
0
0
Rather than using the SignalTap GUI, I'd like to instantiate a SignalTap core, trigger it with my own software and end up with a vcd file. Reading through the documentation I see one show stopper. It seems the core needs to communicate through the programming JTAG connection. Is there anyway to communicate with the core over the Avalon bus instead? Something like an Avalon to JTAG-tap bridge would probably do the trick and might not be too hard to write, but I don't have the time to write/debug one. Also, how can I tell where it stores the log in on-chip memory? And were can I find documentation about how to decode the log?

I may never get around to this, but if someone out there has a quick and easy solution I'd make use of it.

Is this the function to use for basic read from Max 10 ADC?

$
0
0
Hi.

I'm putting a Max10 ADC into my NIOS2 based design. I have not been able to find any examples for writing NIOS C code to read Max10 ADC. I'm sure it's simple, but getting the includes, drivers, declarations and pointers right can be tricky. I am piecing it together though, and have found something hopeful in the docs.

The following is from the NIOS2 user manual-
Is this the correct function to read from dedicated ANIN channel 0, slot 0, no sequencer?

" 15.3.12 alt_adc_word_read Prototype

int alt_adc_word_read (alt_u32 sample_store_base, alt_u32* dest_ptr, alt_u32 len)
Arguments • sample_store_base: Base address of sample store core. • *dest_ptr: destination buffer • len: number of 32-bit reads
Description Reads words from the sample store "

Thanks,
Bob

Error (10779): VHDL error at memory.vhd(30): expression is not constant

$
0
0
Hello, i have an issue on this vhdl code, i need to increment the index of my vector to fill up a memory. the problem is that quartus reports me this error when i try to put a variable as an index like ( A downto B) where A and B are variables...
thank you for the help!
here is the code:



  1. LIBRARY ieee;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3. use IEEE.STD_LOGIC_SIGNED.ALL;
  4. USE ieee.numeric_std.all;
  5. USE std.standard;
  6. entity memory is
  7. Port ( Clk : in std_logic; -- processing clock
  8. wr : in std_logic; -- write enable signal
  9. cs : in std_logic ;-- select memory
  10. rd : in std_logic; -- enable reading from memory
  11. add : in std_logic_vector(9 downto 0); -- write address to store the data into ram
  12. data_in : in signed(7 downto 0); -- input data to store into ram
  13. data_out : out signed(7 downto 0)); -- output data from memory
  14. end memory;
  15. architecture Behaviour of memory is
  16. signal tmp: integer range 0 to 1023 := 0 ;
  17. signal tmp1,tmp2: integer range 0 to 8184:= 0;
  18. signal storage: signed (8184 downto 0);
  19. begin
  20. tmp <= to_integer(unsigned(add));
  21. tmp1 <= 7+ tmp*8;
  22. tmp2 <= tmp*8;
  23. process(Clk)
  24. begin
  25. if Clk'event and Clk = '1' then
  26. if (wr = '1' and cs='1') then -- In this process writing the input data into memory
  27. storage(tmp1 downto tmp2) <= data_in;
  28. end if;
  29. if (cs='1' and rd='1') then
  30. data_out <= storage(tmp1 downto tmp2) ;
  31. end if;
  32. end if;
  33. end process; -- asynchronous reading from memory
  34. end Behaviour;

Latha

$
0
0
hi,
Any one help me to write code for the TDC architecture in the attachement
[IMG]file:///C:/Users/DELL/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg[/IMG]
Attached Files

error 12006 help

$
0
0
I am getting the error 12006 when i try to compile this code and cant see whats wrong with it can anyone help please?

library ieee;
use ieee.std_logic_1164.all;


entity mux2_1_struct is
port ( s,c,p : in std_logic;
m : out std_logic) ;
end mux2_1_struct;


architecture struct of mux2_1_struct is


component and_mux is
port ( x,y : in std_logic;
f : out std_logic);
end component;

component or_mux is
port (x,y : in std_logic;
f : out std_logic);
end component;

component not_mux is
port( x : in std_logic;
f : out std_logic);
end component;

signal n1,n2,n3 : std_logic;

begin

and_mux1 : and_mux port map ( x => c , y => n3 , f => n1);

and_mux2: and_mux port map ( x => s , y => p , f => n2);

not_mux1 : not_mux port map ( x => s , f => n3 );

or_mux1 : or_mux port map ( x => n1 , y => n2 , f => m);

end struct;






The error messages im getting are
Error (12006): Node instance "and_mux2" instantiates undefined entity "and_mux". Ensure that required library paths are specified correctly, define the specified entity, or change the instantiation. If this entity represents Intel FPGA or third-party IP, generate the synthesis files for the IP.

C help with read/write to Qsys component

$
0
0
I am using the Data Pattern Generator/Checker IP in a Qsys file and trying to configure it via a NIOS. However, I am having some trouble. I am using IOWR_32DIRECT() and IORD_32DIRECT() to write and read configuration data but I am not getting correct data when I try to enable the IP cores.

I've attached the Qsys, C code, and the terminal output. I'd like someone to review it and let me know if there is something in the code that would cause the issue. The puts and printf works but the IORD's don't give the correct values. I checked the Qsys and it looks like everything is connected up correctly.

Thanks for your help.



Hello_world_small.c

// "Small Hello World" example.

#include "sys/alt_stdio.h"
#include "system.h"
#include <io.h>
#include "os/alt_syscall.h"
#include <unistd.h>

int alt_main()
{
unsigned int PRBS15 = 0x2;
unsigned int ENABLE = 0x1;

alt_putstr("Hello from Nios II!\n\n");
usleep(500000);

alt_putstr("Begin configuration of Pattern Generator\n\n");
usleep(500000);

alt_putstr("Setting pattern to PRBS15...\n");
usleep(500000);


IOWR_32DIRECT(DATA_PATTERN_GENERATOR_0_BASE, 4, PRBS15);
usleep(500000);
alt_printf("The value read from Generator is %x\n", IORD_32DIRECT(DATA_PATTERN_GENERATOR_0_BASE, 4));
usleep(500000);

IOWR_32DIRECT(DATA_PATTERN_CHECKER_0_BASE, 4, PRBS15);
usleep(500000);
alt_printf("The value read from Checker is %x\n\n", IORD_32DIRECT(DATA_PATTERN_CHECKER_0_BASE, 4));
usleep(500000);



alt_putstr("Enabling pattern generator...\n");
usleep(500000);


IOWR_32DIRECT(DATA_PATTERN_CHECKER_0_BASE, 0, ENABLE);
usleep(500000);
alt_printf("The value read from Checker is %x\n", IORD_32DIRECT(DATA_PATTERN_CHECKER_0_BASE, 0));
usleep(500000);


IOWR_32DIRECT(DATA_PATTERN_GENERATOR_0_BASE, 0, ENABLE);
usleep(500000);
alt_printf("The value read from Generator is %x\n\n", IORD_32DIRECT(DATA_PATTERN_GENERATOR_0_BASE, 0));
usleep(500000);

return 0;
}



Terminal Output


Hello from Nios II!

Begin configuration of Pattern Generator

Setting pattern to PRBS31…
The value read from Generator is 8
The value read from Checker is 8

Enabling pattern generator…
The value read from Checker is 0
The value read from Generator is 0

End
Attached Files

Using GPIO of De1SoC

$
0
0
Hello,

Can i use the GPIO of De1SoC, with the given BSP by terasic? And how to program it through? OpenCL or Host program?

thanks

altsyncram 1 word

$
0
0
GUI doesn't allow one to select RAM word size to one. Do you if it's even possible to generate a RAM containing only one word?

TCP Ethernet packet in FPGA?

$
0
0
Hi,

I have a Cyclone IV GX transceiver kit. I want to observe TCP packets in signal tap in FPGA (and hopefully it'll be same as the one I observe in Wireshark) How do I do that?

This is what I want to do:
(1) step 1: Send a TCP packet to my own computer using a client program.
(2) step 2: connect ethernet cable from my modem to the transceiver on my FPGA.
(3) step 3 (greatest confusion here): get a clean packet (data, valid, start of packet, end of packet) into my FPGA.
(4) step 4: observe packets in signal tap. Hopefully this will be the same I see in wire shark.

How do I accomplish this? What IP's do I need to instantiate? Any help truly appreciated. I've never done anything like this before....


Thanks.
giga

Arria 10 Dev Kit - DDR4 calibration failed

$
0
0
Hi everyone,

I can't get the DDR4 module that comes with the Arria 10 Dev Kit to work. When I configure the DDR4 design using BTS, I get "DDR4 calibration failed, test won't work" error message. All other examples working fine (Flash/GPIO, FMC loopback and DDR3). Is there any configuration / setting that I am not ware of?

Thanks

The HPS GPIO registers are unavailable

$
0
0
Hello,
I am starting a bare-metal development on DE0-Nano-SoC_Computer.
I use the development tool: DS5 AE.
I begin by a timer program found in the document “DE0-Nano-SoC Computer System with ARM Cortex-A9”:
equ bit_24_pattern, 0x01000000
/* This program provides a simple example of code for the ARM A9. It:
* 1. starts the ARM A9 private timer
* 2. loops forever, toggling the HPS green light LEDG when the timer expires
*/
.text
.global _start
_start:
LDR R0, =0xFF709000 // GPIO1 base address
LDR R1, =0xFFFEC600 // MPCore private timer base address
LDR R2, =bit_24_pattern // value to turn on the HPS green light LEDG
STR R2, [R0, #0x4] // write to the data direction register to set
// bit 24 (LEDG) of GPIO1 to be an output
LDR R3, =200000000 // timeout = 1/(200 MHz) x 200×10∧6 = 1 sec
STR R3, [R1] // write to timer load register
MOV R3, #0b011 // set bits: mode = 1 (auto), enable = 1
STR R3, [R1, #0x8] // write to timer control register
LOOP:
STR R2, [R0] // turn on/off LEDG
WAIT: LDR R3, [R1, #0xC] // read timer status
CMP R3, #0
BEQ WAIT // wait for timer to expire
STR R3, [R1, #0xC] // reset timer flag bit
EOR R2, R2, #bit_24_pattern // toggle LEDG value
B LOOP
.end

The HPS GPIO registers are unavailable, it’s impossible to see the values in the registers tab of DS5.
The values of addresses 0xFF709000 are 0x00000000 in the memory tab of DS5.

Is it necessary to initialize the GPIO before launching the program?

Thanks for your help.
Jerome

Wrong Timeout Value with ARM A9 private timer.

$
0
0
Hello,
I am starting a bare-metal development on DE0-Nano-SoC_Computer.
I use the development tool: DS5 AE.
I begin by a timer program found in the document “DE0-Nano-SoC Computer System with ARM Cortex-A9”:
equ bit_24_pattern, 0x01000000
/* This program provides a simple example of code for the ARM A9. It:
* 1. starts the ARM A9 private timer
* 2. loops forever, toggling the HPS green light LEDG when the timer expires
*/
.text
.global _start
_start:
LDR R0, =0xFF709000 // GPIO1 base address
LDR R1, =0xFFFEC600 // MPCore private timer base address
LDR R2, =bit_24_pattern // value to turn on the HPS green light LEDG
STR R2, [R0, #0x4] // write to the data direction register to set
// bit 24 (LEDG) of GPIO1 to be an output
LDR R3, =200000000 // timeout = 1/(200 MHz) x 200×10∧6 = 1 sec
STR R3, [R1] // write to timer load register
MOV R3, #0b011 // set bits: mode = 1 (auto), enable = 1
STR R3, [R1, #0x8] // write to timer control register
LOOP:
STR R2, [R0] // turn on/off LEDG
WAIT: LDR R3, [R1, #0xC] // read timer status
CMP R3, #0
BEQ WAIT // wait for timer to expire
STR R3, [R1, #0xC] // reset timer flag bit
EOR R2, R2, #bit_24_pattern // toggle LEDG value
B LOOP
.end

The timeout is not 1 sec but about 40 sec. the good value is 5 000 000 instead of 200 000 000.
Is it necessary to initialize the system clocks before launching the program?
Thanks for your help.
Jerome

Why do cyrillic characters not display correctly in Quartus Prime Pro Edition 18.0?

$
0
0
Why do Cyrillic characters not display correctly in Quartus Prime Pro Edition 18.0?

Can't load .jic file to EPCQ device

$
0
0
My custom board is equipped with the Cyclone V FPGA and the EPCQ128 configuration device. I use Quartus 17.1.0.

I convert the .sof programming file to .jic having the Active serial x4 option selected.

Using the same .jic file, depending on MSEL pins configuration, for
  • for MSEL set to active serial standard (10011) I am able to configure and program the flash memory
  • for MSEL set to active serial fast (10010) I get an error message:
    Quote:

    Error (209025): Can't recognize silicon ID for device 1. A device's silicon ID is different from its JTAG ID. Verify that all cables are securely connected, select a different device, or check the power on the target system. Make sure the device pins are connected and configured correctly.
    Error (209012): Operation failed


Thus, I have questions:
  1. Why am I not able to configure the device with MSEL set to active serial fast?
  2. Which configuration has priority MSEL or settings during conversion of .sof files to .jic?
  3. If I understand correctly, MSEL and settings during conversion of .sof to .jic apply to FPGA configuration from the configuration device during boot. Where can one control mode in which the FPGA access the configuration device (ex. 1 vs 4 data lines) during indirect jTag programming? What is the setting by default?

Various Issues getting started

$
0
0
We're trying some FPGA experiments, and are having issues getting through the Getting Started documentation for the Arria 10 GX here:

https://www.altera.com/documentation...191698959.html

We are at step 6:


  • Program the flash memory on the board as follows:
    • Set the AOCL_BOARD_PACKAGE_ROOT environment variable to point the folder that contains your Intel® Arria® 10 reference BSP folder:
      INTELFPGAOCLSDKROOT/board/a10_ref Where INTELFPGAOCLSDKROOT in the installation path for the Intel® FPGA SDK for OpenCL™ .
    • Run the following command to program the flash memory. This command does not use PCIe. It requires only JTAG.
      aocl flash acl0 boardtest.aocx


The current problem I'm having is this:

Code:

$ source /home/drd/intelFPGA_pro/18.0/hld/init_opencl.sh
INTELFPGAOCLSDKROOT is set to /home/drd/intelFPGA_pro/18.0/hld. Using that.

Will use $QUARTUS_ROOTDIR_OVERRIDE= /home/drd/intelFPGA_pro/18.0/quartus  to find Quartus

AOCL_BOARD_PACKAGE_ROOT is set to /home/drd/intelFPGA_pro/18.0/hld/board/a10_ref. Using that.
Adding /home/drd/intelFPGA_pro/18.0/hld/bin to PATH
Adding /home/drd/intelFPGA_pro/18.0/hld/host/linux64/lib to LD_LIBRARY_PATH
Adding /home/drd/intelFPGA_pro/18.0/hld/board/a10_ref/linux64/lib to LD_LIBRARY_PATH

$ aocl flash acl0 boardtest.aocx
Cannot find board_env.xml in /home/drd/intelFPGA_pro/18.0/hld/board/s10_ref

Almost any other command I try fails with the error of finding board_env.xml for s10_ref, even though when installing Quartus Pro, I skipped installing the Stratix 10 device.

Trying to install the Stratix 10 device and running as root are giving the same error. Any help is appreciated.

Strange PLL Clock causing me failing paths in cyc V design

$
0
0
Dear all,

TimeQuest is warning me of a failing path in my Altera Cyclone V FPGA design.
It says failing path with:

Code:

Slack______From Node ____________________________________ ____to Node __________Launch Clock ____________________________________________________________________________Latch clock____Relationship __Clock Skew ___Data Delay
-9.115 ____    io_control:io_control_inst1|data_out[21] _______    dq[21] _______    pll_inst_100|pll_100_inst|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk ______  clk_100____    10.000 ____    -10.144______2.901

I wonder what is the problem here and what clock divclk is? The entity io_control flops the data from inside the design and tristating it to dq. dq is an Input / Output Port at the top level design.
IO_control has clock input clk_100. clk_100 is routed globally through the design with an ALTCLKCTRL. The clk_100 is feed to external hardware via ALTDDIO which is consuming dq.
Here is the code of IO_control:

Code:

flopping_data_out_proc : process(CLK, RESET)begin
    if (RESET = '0') then
        data_out <= (others => '0');
    elsif (rising_edge(CLK)) then
        data_out <= Fin_DATA_ram;    -- comes from inside FPGA Design
    end if;
end process flopping_data_out_proc;


mux_data_out_proc : process(slrd_en, data_out)
begin
    if (slrd_en = '0') then
        DATA <= data_out;        -- DATA is output of IO Control and wired to DQ
    else
        DATA <= (others => 'Z');
    end if;
end process;

Can somebody enlighten me if this is a critical issue? I set all needed timing constraints but wonder if I had to add a multicycle path or set false path between these clocks?
It is noticeable that the fitter puts out a warning during fitting:

Code:

Warning (332049): Ignored create_clock at SDC1.sdc(2): Incorrect assignment for clock.  Source node: CLOCK_50_B5B already has a clock(s) assigned to it.  Use the -add option to assign multiple clocks to this node.  Clock was not created or updated.
    Info (332050): create_clock -name CLK1 -period 20.0 [get_ports {CLOCK_50_B5B}]

This is also the clock which feed the pll (clk_100) as reference clock. Can you help me clarifying this issue?



I added the archive file in the attachments.
Thank you for any help.
Attached Files
Viewing all 19390 articles
Browse latest View live


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