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

altmult_add

$
0
0
Hi,

i have two questions:
1- how the altmult_add megafunction can be used in a pipelined structure?
2- which method is the best to calculate inner product of two vectors, having 3 elements, in a pipelined structure:a altmult_add with 3 input or 2 lpmmult mfs and 2 lpmadd_sub mfs?

Regards,

Bedri

Nios and tcl script writing to RAM

$
0
0
Hi,

I have an image loaded with a Nios , Jtag master and jtag UART.

I have wrote C code to write to the on-chip RAM. I have also a tcl script that can read and write to the RAM.

When I write and read to/ from a location with C code as follows :

Code:


unsigned int* mem_ptr = (unsigned int*) 0x40000060;
*mem_ptr = 0xff00;
printf("Value is 0x%x\n", *mem_ptr);

the correct value is read back fine with printf() but when I source a tcl script to read from the same location using "ram_read 0", I am getting different values :

Code:

proc ram_read {offset} {
        global jtag
        if {![info exists jtag(master)]} {
                jtag_open
        }
        set addr [expr {0x40000060 + ($offset & ~3)}]
        return [master_read_32 $jtag(master) $addr 1]
}

When I tried this yesterday however, the correct values were being read back. I don't understand why now the printf() prints the correct value but the tcl script does not. Should the values be the same? Can anyone see where I am going wrong here or if I am going wrong at all? Thanks in advance.

Cyclone V DE1-SoC error message

$
0
0
Hi guys, i have a problem with programming my Cyclone V DE1-SoC. I am new with FPGA and i just started learning verilog and Quartus for my school. I tried to do first lab from altera website where you write a simple code to turn on LEDR using switches. My first code was uploaded nice and everything worked fine. But when i tried to upload second code, i got "failed" message in Quartus programmer. Now simple LEDR code is stuck in the FGPA and its still there even after I turn the power Off and back ON. Every time i try to program it with new code, i get the message on the FGPA display as you see it in the attached picture. Can anyone help me to reset it factory settings with factory flash? i tried using Quartus programmer to erase FPGA ( from my understanding, in the manual it says it will upload factory default settings) but it didn't work. Anyone knows that this message mean?

Thank you in advance for your time and assistance.
V
Attached Images

I need code pwm for vhdl

$
0
0
Hi,I am new in fpgas and i work a project about pwm.Help me please

Is anyone doing simulation in Quartus II version 12?

$
0
0
I am using Quartus II version 12 web version. It seems there is no in-built simulator. From site I can download modelsim from Mentor Graphics. How much time it will take to download? I am in a big hurry. As an alternate please suggest a different version with in-built simulator.

UFM EDA simulation in modelsim problem

$
0
0
I try to simulate EDA UFM component in modelsim.

My UFM content is filled manually in file 'UFMControlMemory.v'. (ABCD data)

Simulation Generated files: 'UFMControlMemory.vo' and 'UFMControlMemory_v.sdo'

Simulation result in file 'simulationResult.png'.

No matter what address will be set I get '1111111111111111' output.

In generated files I do not see entries about UFM content.

What did I miss?

Sorry for My English.
Attached Files

Questions about recompiling the programs written by Quartus II 9.1 with Quartus II 13

$
0
0
When recompile the programs written by Quartus II 9.1 with Quartus II 13.0 and programme the new POF file into the FPGA(EP1C12), I find that the FPGA does not work the same as being programmed with the POF file produced by Quartus II 9.1.
So I wonder whether the POF file produced by Quartus II 13.0 is wrong. Are something of compiler of Quartus II 13.0 should be set up before recompiling programs written by Quartus II 9.1? Or 13.0 and 9.1 are not Compatible?
Looking forward to your help!

is it matrices supported by Altera DSP builder

$
0
0
Hi guys.

I have 64x64 matrices in my design. I want to convert it into HDL code. Can Altera DSP builder convert this matrix into HDL code? Thanks in advance.

Interrupt on my radar application - what have I been programming ?

$
0
0
Dear Forum users,

I implemented with verilog a simple 32 bit wide COUNTER. Then I read the counter out with
Nios and I implemented on my radar application two switches - one switch for starting the
radar pulse and one switch for displaying the result on the RS232. Now the code it functions
but I do not know what I have been implementing with version 9.1.

The code will look as follows:

//PAVLE DUKANOVIC
//www.dukelanovic.com
//Neckarrems,19.10.2014
//
//RS232 COMMUNICATIONS
//


#include<stdio.h>
#include<string.h>
#include "altera_avalon_pio_regs.h"
#include "alt_types.h"
#include "unistd.h"
#include "system.h"
#include "sys/alt_irq.h"




#define seg *(volatile unsigned char *) SEG_BASE
#define bit *(volatile unsigned char *) BIT_BASE
#define RESET *(volatile unsigned char *) RESET_BASE
#define TRIG *(volatile unsigned char *) TRIG_BASE
#define COUNTER *(volatile alt_u32 *) COUNTER_BASE
#define START *(volatile alt_u32 *) START_BASE
const alt_u8 duan[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x9 0};
// 0 1 2 3 4 5 6 7 8 9
alt_u8 num[8] = {0,0,0,0,0,0,0,0};
alt_u8 number[8];
alt_u32 n = 0;


alt_u8 key_flag;
alt_u8 key_flag1;


volatile int edge_capture;


void key_ISR(void* context, alt_u32 id)
{
IOWR_ALTERA_AVALON_PIO_EDGE_CAP(START_BASE,0);
IORD_ALTERA_AVALON_PIO_EDGE_CAP(START_BASE);
key_flag = 1;
}


void key3_ISR(void* context, alt_u32 id)
{
IOWR_ALTERA_AVALON_PIO_EDGE_CAP(K3_BASE,0);
IORD_ALTERA_AVALON_PIO_EDGE_CAP(K3_BASE);
key_flag1 = 1;

}








void key_Init()
{
IOWR_ALTERA_AVALON_PIO_IRQ_MASK(START_BASE,0xF);
IOWR_ALTERA_AVALON_PIO_EDGE_CAP(START_BASE,0x0);
alt_irq_register(START_IRQ,NULL,key_ISR); //START_IRQ 3
}


void key3_Init()
{
IOWR_ALTERA_AVALON_PIO_IRQ_MASK(K3_BASE,0xF);
IOWR_ALTERA_AVALON_PIO_EDGE_CAP(K3_BASE,0x0);
alt_irq_register(K3_IRQ,NULL,key3_ISR); //START_IRQ 3
}


// This function will display 8 Numbers
void display(alt_u32 i)
{

alt_u8 j;
num[0] = ((((((i % 10000000)%1000000)%100000)%10000)%1000)%100)%10;
num[1] = ((((((i % 10000000)%1000000)%100000)%10000)%1000)%100)/10;
num[2] = (((((i % 10000000)%1000000)%100000)%10000)%1000)/100;
num[3] = ((((i % 10000000)%1000000)%100000)%10000)/1000;
num[4] = (((i % 10000000)%1000000)%100000)/10000;
num[5] = ((i % 10000000)%1000000)/100000;
num[6] = (i % 10000000)/1000000;
num[7] = i / 10000000;

for(j=0; j<8; j++)
{
bit = ~(0x01 << j);
seg = duan[num[j]]; // here the display is switched on
usleep(100);
}

number[7] = ((((((i % 10000000)%1000000)%100000)%10000)%1000)%100)%10+0x 30;
number[6] = ((((((i % 10000000)%1000000)%100000)%10000)%1000)%100)/10+0x30;
number[5] = (((((i % 10000000)%1000000)%100000)%10000)%1000)/100+0x30;
number[4] = ((((i % 10000000)%1000000)%100000)%10000)/1000+0x30;
number[3] = (((i % 10000000)%1000000)%100000)/10000+0x30;
number[2] = ((i % 10000000)%1000000)/100000+0x30;
number[1] = (i % 10000000)/1000000+0x30;
number[0] = i / 10000000+0x30;

}


int main ()
{

char* msg = "M01 ";
FILE* fp;



key_Init();
key3_Init();
printf("RS232 DEMO : \n");
fp = fopen (UART_NAME, "r+"); // here we initialize the RS232 port
RESET = 1;

TRIG =1;
while(1){

n = COUNTER;
display(n);
usleep(100);

if(key_flag){

TRIG = 0;
usleep(10);
fwrite (msg, strlen (msg), 1, fp); // here we write on the RS232
usleep(40000);

key_flag = 0;
TRIG = 1;

}

if(key_flag1){
fwrite (number, strlen (number), 1, fp); // here we write on the RS232
key_flag1 = 0;
}

}

return 0;
}



Can you tell me where I can find a good reference about programming and handling interrupts?

What have I been doing with the initialisation of my interrupt?

void key_Init()
{
IOWR_ALTERA_AVALON_PIO_IRQ_MASK(START_BASE,0xF);
IOWR_ALTERA_AVALON_PIO_EDGE_CAP(START_BASE,0x0);
alt_irq_register(START_IRQ,NULL,key_ISR); //START_IRQ 3
}

What do those commands mean ?

Please help me.

Querry about MAX 7000s CPLD

$
0
0
I would like to know the feasibility of "EPM7128slc-10" CPLD IC, whether I can use it in the application, "Using CPLD as a microcontroller I/O expander". The link regarding details is given below:
http://www.altera.com/literature/an/...T.oss=expander

In this link, there are maxII, max3000 and max10 CPLDs used for this application. If max 7000s can also be used in this application, then please notify me.

Thank you.

Querry about using CPLD as a microcontroller I/O expander

$
0
0
I want to use MAX EPM7128slc-10 CPLD IC as a microcontroller I/O expander. Is it possible to use this IC? If there is any limitation, please mention.
The link for this project from altera is given below:
http://www.altera.com/literature/an/an265.pdf

Thank you.

pll scandataout strange behaviour

$
0
0
scandataout pin from PLL shifts out data in a strange manner (see my attached picture).
according to cyclone 3 datasheet, first bit that comes out from scandataout is bit 144 which belongs
to pll devider Counter4 LSB. then, after 18cycles Counter 3 should come out, then after next
18 cycles C2, 18cycles C1 and 18cycles C0. but in my picture here not only entire
scandataout answer is messed up but the counter sequance is also messed up.
maybe it is related to the fact that i created clk0 output first. then clk4 output and then
clk3 output. the signal from scandataout kind of has that sequence but it's totally wrong.
have i missunderstood something or is this an error...?
Attached Images

"VCC" label on input pins in Quartus II schematic file?

$
0
0
Why is "VCC" (or GND if I set it to that) label on all input pins in Quartus II schematic?

matrix multiplication using verilog

$
0
0
I have coded a matrix multiplication. matrix size is 4 by 4 and the data size is 1 bit. It shows some structure in RTL view but nothing is seen is technology map viewer and it shows 0 LEs are used. Please help.....
//matrix multiplication:

module matmul(clk,a,b,c);
input clk,a,b;
output reg c;
reg sum;
reg ra[3:0][3:0];
reg rb[3:0][3:0];
reg rc[3:0][3:0];
integer i1,i2,i3,j1,j2,j3,k;


always@(posedge clk)
for(i1=0;i1<=3;i1=i1+1)
begin
for(j1=0;j1<=3;j1=j1+1)
begin
ra[i1][j1]=a;
rb[i1][j1]=b;
end
end

always@(posedge clk)
for(i2=0;i2<=3;i2=i2+1)
begin
for(j2=0;j2<=3;j2=j2+1)
begin
sum=1'b0;
for(k=0;k<=3;k=k+1)
begin
sum=sum^ra[i2][k]*rb[k][j2];
end
rc[i2][j2]=sum;
end
end


always@(posedge clk)
for(i3=0;i3<=3;i3=i3+1)
for(j3=0;j3<=3;j3=j3+1)
c=rc[i3][j3];
endmodule

VHDL code for register, to use in a binary multiplication circuit

$
0
0
I wrote a piece a VHDL code for a register (to make a shift register circuit) in a binary multiplication circuit. Once I analyzed it in Quartus II several syntax errors were displayed.
This is my code:

ENTITY memory IS
PORT (can_load, can_shift, can_ad, sb_input, ab_input, UserInput : IN BIT;
Out_Bit, Z : OUT BIT);
END memory;

ARCHITECTURE logic OF memory IS
SIGNAL State: BIT := '0';
BEGIN
IF (can_load = '1') THEN
State <= UserInput;
ELSE
IF (can_ad = '1')
THEN Z <= State; --Z is the output that goes to the 4 bit adder
State <= ab_input;
END IF;
IF (can_shift = '1') THEN
Out_Bit <= State;
State <= sb_input;
END IF;
END IF;
END logic;

This are the error messages:

Info: ************************************************** *****************

Info: Running Quartus II 64-Bit Analysis & Synthesis Info: Version 14.0.0 Build 200 06/17/2014 SJ Web Edition Info: Processing started: Sun Oct 19 16:28:22 2014 Info: Version 14.0.0 Build 200 06/17/2014 SJ Web Edition Info: Processing started: Sun Oct 19 16:28:22 2014
Info: Command: quartus_map --read_settings_files=on --write_settings_files=off memory -c memory
Warning (20028): Parallel compilation is not licensed and has been disabled
Error (10500): VHDL syntax error at memory.vhd(9) near text "IF"; expecting "end", or "(", or an identifier ("if" is a reserved keyword), or a concurrent statement
Error (10500): VHDL syntax error at memory.vhd(9) near text "THEN"; expecting "<="
Error (10500): VHDL syntax error at memory.vhd(11) near text "ELSE"; expecting "end", or "(", or an identifier ("else" is a reserved keyword), or a concurrent statement
Error (10500): VHDL syntax error at memory.vhd(12) near text "THEN"; expecting "<="
Error (10500): VHDL syntax error at memory.vhd(15) near text "IF"; expecting ";", or an identifier ("if" is a reserved keyword), or "architecture"
Error (10500): VHDL syntax error at memory.vhd(16) near text "THEN"; expecting "<="
Error (10500): VHDL syntax error at memory.vhd(19) near text "IF"; expecting ";", or an identifier ("if" is a reserved keyword), or "architecture"
Info (12021): Found 0 design units, including 0 entities, in source file memory.vhd
I have already checked several books for the correct syntax, and code examples and yet I cannot find where's my mistake.
I also tried to take away the parentheses in sections like this:

IF (can_load = '1') THEN

having something like this:

IF can_load = '1' THEN

but I ended up with most of the same syntax errors.

I'd appreciate any help to solve this issue. Thank you very much.

Quartus supported ROM types

$
0
0
When updating ROM through AS mode, we found that flashing ROM might be failed.

How to check the ROM types of Quartus supported?
Are there any patches for one new ROM type?

LED Breahing DE0 nano

$
0
0
can you help me what the meaning of this short program
it's from demos de0 nano i want to convert it to vhdl


" PWM_width <= PWM_width[5:0]+ PWM_adj;
if(counter[26])
begin
PWM_adj <= counter[25:20];
end
else begin
PWM_adj <= ~ counter[25:20];
end "




this the full demos program
// ================================================== ==========================
// Copyright (c) 2011 by Terasic Technologies Inc.
// ================================================== ==========================
//
// Permission:
//
// Terasic grants permission to use and modify this code for use
// in synthesis for all Terasic Development Boards and Altera Development
// Kits made by Terasic. Other use of this code, including the selling
// ,duplication, or modification of any portion is strictly prohibited.
//
// Disclaimer:
//
// This VHDL/Verilog or C/C++ source code is intended as a design reference
// which illustrates how these types of functions can be implemented.
// It is the user's responsibility to verify their design for
// consistency and functionality through the use of formal
// verification methods. Terasic provides no warranty regarding the use
// or functionality of this code.
//
// ================================================== ==========================
//
// Terasic Technologies Inc
// 356 Fu-Shin E. Rd Sec. 1. JhuBei City,
// HsinChu County, Taiwan
// 302
//
// web: http://www.terasic.com/
// email: support@terasic.com
//
// ================================================== ==========================
// Major Functions/Design Description:
//
// Please refer to DE0_Nano_User_manual.pdf in DE0_Nano system CD.
//
// ================================================== ==========================
// Revision History:
// ================================================== ==========================
// Ver.: |Author: |Mod. Date: |Changes Made:
// V1.0 |EricChen |02/01/2011 |
// ================================================== ==========================

//================================================== =====
// This code is generated by Terasic System Builder
//================================================== =====

module DE0_NANO(

//////////// CLOCK //////////
CLOCK_50,

//////////// LED //////////
LED,

//////////// KEY //////////
KEY,

//////////// SW //////////
SW,

//////////// SDRAM //////////
DRAM_ADDR,
DRAM_BA,
DRAM_CAS_N,
DRAM_CKE,
DRAM_CLK,
DRAM_CS_N,
DRAM_DQ,
DRAM_DQM,
DRAM_RAS_N,
DRAM_WE_N,

//////////// EPCS //////////
EPCS_ASDO,
EPCS_DATA0,
EPCS_DCLK,
EPCS_NCSO,

//////////// Accelerometer and EEPROM //////////
G_SENSOR_CS_N,
G_SENSOR_INT,
I2C_SCLK,
I2C_SDAT,

//////////// ADC //////////
ADC_CS_N,
ADC_SADDR,
ADC_SCLK,
ADC_SDAT,

//////////// 2x13 GPIO Header //////////
GPIO_2,
GPIO_2_IN,

//////////// GPIO_0, GPIO_0 connect to GPIO Default //////////
GPIO_0_D,
GPIO_0_IN,

//////////// GPIO_0, GPIO_1 connect to GPIO Default //////////
GPIO_1_D,
GPIO_1_IN,

);

//================================================== =====
// PARAMETER declarations
//================================================== =====


//================================================== =====
// PORT declarations
//================================================== =====

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

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

//////////// KEY //////////
input [1:0] KEY;

//////////// SW //////////
input [3:0] SW;

//////////// 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;

//////////// EPCS //////////
output EPCS_ASDO;
input EPCS_DATA0;
output EPCS_DCLK;
output EPCS_NCSO;

//////////// Accelerometer and EEPROM //////////
output G_SENSOR_CS_N;
input G_SENSOR_INT;
output I2C_SCLK;
inout I2C_SDAT;

//////////// ADC //////////
output ADC_CS_N;
output ADC_SADDR;
output ADC_SCLK;
input ADC_SDAT;

//////////// 2x13 GPIO Header //////////
inout [12:0] GPIO_2;
input [2:0] GPIO_2_IN;

//////////// GPIO_0, GPIO_0 connect to GPIO Default //////////
inout [33:0] GPIO_0_D;
input [1:0] GPIO_0_IN;

//////////// GPIO_0, GPIO_1 connect to GPIO Default //////////
inout [33:0] GPIO_1_D;
input [1:0] GPIO_1_IN;


//================================================== =====
// REG/WIRE declarations
//================================================== =====
wire reset_n;

reg [26:0] counter;
reg [5:0] PWM_adj;
reg [6:0] PWM_width;
reg [7:0] LED;
reg [33:0] GPIO_0_D;


//================================================== =====
// Structural coding
//================================================== =====

assign reset_n = KEY[0];

always @(posedge CLOCK_50 or negedge reset_n)
begin
if(!reset_n)
begin
counter <= 0;
LED[0] <= 0;
GPIO_0_D[2]<= 0;
end
else begin
counter <= counter+1;
PWM_width <= PWM_width[5:0]+ PWM_adj;
if(counter[26])
begin
PWM_adj <= counter[25:20];
end
else begin
PWM_adj <= ~ counter[25:20];
end
LED[0] <= ~PWM_width[6];
LED[1] <= ~PWM_width[6];
LED[2] <= ~PWM_width[6];
LED[3] <= ~PWM_width[6];
LED[4] <= PWM_width[6];
LED[5] <= PWM_width[6];
LED[6] <= PWM_width[6];
LED[7] <= PWM_width[6];
GPIO_0_D[2]<= PWM_width[6];
end
end



endmodule

Quartus supported ROM types

$
0
0
When updating ROM through AS mode, we found that flashing ROM might be failed.

How to check the ROM types of Quartus supported?
Are there any patches for one new ROM type?

Erros after completing migration from SOPC to Qsys

$
0
0
Hey guys, I'm extremely new to this software. I was asked to investigate how to migrate from SOPC to Qsys, i have had no previous experience regarding this; however; I have succesfuly managed to migrate a design from SOPC to Qsys. Now that the migration process is complete I have some errors and eventhough I've been searching for solutions in the Altera Guidelines I haven't found something that may help me. These are the errors:

Description: Path
Device family is unknown. System.pll
Device family is unknown System.onchip_mem
Multiplier selected is not compatible with selected device and design type System.cpu
can't read "allowed_multiplier": System.cpu

Honestly, I have no clue of what any of these mean, I was asked to the migration process but I have no experience whatsoever, I hope you guys can help me figure this out! I'm using Quartus 13.1 Edition, Thanks in advance!

Cyclone 5 GT Dev. Kit DDR3 malfunction

$
0
0
Hi all,

I am using cyclone 5 GT dev. kit which consists of both hard memory and soft memory controller. I am using the board test system provided by altera to check the functioning of DDR3's. For DDR3 A and B when the start button is pressed the read, write and total percentages is at zero percentage and when the process is stopped the percentages still remain at zero level. The number of addresses to read and write is set to maximum. I have attached the images for DDR3 A start and stop condition.

Please let me know how to debug this? Are the memories have gone bad?

Regards,
Prakhar
Attached Images
Viewing all 19390 articles
Browse latest View live


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