Altera_Forum
Honored Contributor
21 years agoQUARTUS 4.2 NIOS 1.1 UPDATE PROBLEM
After update to Quartus 4.2 and Nios 1.1
I have a problem with an 8-Bit Slave (user logic) the adress lines are connected as follows CPU A 9 8 7 6 5 4 3 2 1 0 8-BIT SLAVE A 7 6 5 4 3 2 1 0 - - with Quartus 4.1 NIOS 1.0 data was written and read with IOWR(baseadd,add,data); IORD(baseadd,add); everything worked fine. after update to Quartus 4.2 NIOS 1.1 I've get the following wrong values at the address lines. by using IORD: BYTE hfce1_read(HFCE1 *pi,BYTE add) { BYTE data; data=IORD(pi->baseadd,add); return data; } 0x0080d0e8 <hfce1_read>: addi sp,sp,-12 0x0080d0ec <hfce1_read+4>: stw fp,8(sp) 0x0080d0f0 <hfce1_read+8>: mov fp,sp 0x0080d0f4 <hfce1_read+12>: stw r4,0(fp) 0x0080d0f8 <hfce1_read+16>: mov r2,r5 0x0080d0fc <hfce1_read+20>: stb r2,4(fp) 0x0080d100 <hfce1_read+24>: ldw r4,0(fp) 0x0080d104 <hfce1_read+28>: ldbu r2,4(fp) 0x0080d108 <hfce1_read+32>: slli r3,r2,2 0x0080d10c <hfce1_read+36>: ldw r2,4(r4) 0x0080d110 <hfce1_read+40>: add r2,r3,r2 0x0080d114 <hfce1_read+44>: ldwio r2,0(r2) 0x0080d118 <hfce1_read+48>: stb r2,5(fp) 0x0080d11c <hfce1_read+52>: ldbu r2,5(fp) 0x0080d120 <hfce1_read+56>: ldw fp,8(sp) 0x0080d124 <hfce1_read+60>: addi sp,sp,12 0x0080d128 <hfce1_read+64>: ret (A2 of CPU is connected to A0 of slave) CPU A 9 8 7 6 5 4 3 2 1 0 8-BIT SLAVE A 7 6 5 4 3 2 1 0 - - add=0x04 0 0 0 0 0 0 0 1 0 0 (measured CPU Address bus) if I read e.g. add=0x04, the address bus of the cpu is 0x??????04 and this is add=0x01 at slave, which is wrong ------------------------------------------------------------------------------- part from ptf file MODULE HFCE1_0 { class = "altera_avalon_user_defined_interface"; class_version = "2.5"; SYSTEM_BUILDER_INFO { Instantiate_In_System_Module = "0"; Is_Enabled = "1"; Date_Modified = "--unknown--"; View { MESSAGES { } Is_Collapsed = "1"; } Clock_Source = "clk"; } WIZARD_SCRIPT_ARGUMENTS { Imported_Wait = "0"; Nios_Gen_Waits = "1"; Simulate_Imported_HDL = "0"; Port_Type = "Avalon Slave"; HDL_Import = "0"; Timing_Units = "ns"; Unit_Multiplier = "1"; Setup_Value = "40"; Hold_Value = "40"; Wait_Value = "160"; Address_Width = "32"; Module_List = ""; Show_Streaming = "1"; Show_Latency = "0"; Technology = "User Logic"; File_Count = "0"; Port_Count = "6"; Component_Desc = "HFCE1"; Module_Name = ""; } SLAVE avalonS { SYSTEM_BUILDER_INFO { Bus_Type = "avalon_tristate"; Address_Alignment = "native"; Address_Width = "8"; Data_Width = "8"; Has_IRQ = "1"; Base_Address = "0x00903000"; Has_Base_Address = "1"; Read_Wait_States = "160.0ns"; Write_Wait_States = "160.0ns"; Setup_Time = "40.0ns"; Hold_Time = "40.0ns"; Is_Memory_Device = "0"; Uses_Tri_State_Data_Bus = "1"; Is_Enabled = "1"; MASTERED_BY ext_ram_bus/tristate_master { priority = "1"; } IRQ_MASTER cpu/data_master { IRQ_Number = "4"; } } PORT_WIRING { PORT address { direction = "input"; width = "8"; type = "address"; is_shared = "1"; } PORT write_n { direction = "input"; width = "1"; type = "write_n"; is_shared = "1"; } PORT read_n { direction = "input"; width = "1"; type = "read_n"; is_shared = "1"; } PORT data { direction = "inout"; width = "8"; type = "data"; is_shared = "1"; } PORT chipselect_n { direction = "input"; width = "1"; type = "chipselect_n"; } PORT irq_n { direction = "output"; width = "1"; type = "irq_n"; } } } MASTER avalonM { SYSTEM_BUILDER_INFO { Bus_Type = "avalon"; Data_Width = "32"; Address_Width = "8"; Max_Address_Width = "32"; Is_Enabled = "0"; } } SLAVE ahbS { SYSTEM_BUILDER_INFO { Bus_Type = "AHB"; Has_IRQ = "0"; Has_Base_Address = "1"; Address_Width = "10"; Data_Width = "32"; Base_Address = "--unknown--"; Address_Alignment = "native"; Read_Wait_States = "0"; Write_Wait_States = "0"; Is_Enabled = "0"; } } MASTER ahbM { SYSTEM_BUILDER_INFO { Bus_Type = "AHB"; Address_Width = "32"; Max_Address_Width = "32"; Data_Width = "32"; Interrupts_Enabled = "1"; Irq_Scheme = "Individual_requests"; Is_Enabled = "0"; } } HDL_INFO { Imported_HDL_Files = ""; } }