IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> microblaze fxmul
nelson
post Nov 13 2009, 02:00 PM
Post #1


Member
**

Group: Members
Posts: 7
Joined: 12-May 09
Member No.: 2,464



hello, I have followed the Complex_Fir_MB tutorial to implement a FIR filter using fixed point, my target board is an Spartan Starter 3e Rev D.
After building project, to import the application software. EDK give me this error: undefined reference to `FXMUL32'

Because that,I have defined in my Sw file
#define FXMUL32(a,b,DW) ((int32)(((((int64)((int32)(a))*(int64)((int32)(cool.gif))+((int64)1<<((DW)-1)))>>DW))
this is the definition from co_math.h file . Also include co_math and co_types in SW.
Then EDK give me :

In function 'software_fir' 'int64' undeclared (first use in this function)(Each undeclared identifier is reported only once for each function it appears in.)expected ')' before numeric constant.

Later, I use this definition and no error returned:
#define FXMUL32(a,b,DW) ((int32)((((((int32)(a))*((int32)(cool.gif))+(1<<((DW)-1)))>>DW)))
I'm only using the co_int32 type, Is it a correct operation?

Regards
Jorge
Go to the top of the page
 
+Quote Post
meix
post Nov 16 2009, 11:43 AM
Post #2


Advanced Member
***

Group: Impulse Staff
Posts: 32
Joined: 7-May 07
Member No.: 1,338



Hi Jorge,

MicroBlaze is a 32-bit system, so the type int64 is not supported, and the FXMUL32 cannot be used here. If you just change the type to int32 as the result of 32-bit multiplication, however, important data will get lost, and the result you get won't be correct.

Here is a simple function, which splits FXMUL32 into a few FXMUL16's. You can use this function to do the job of FXMUL32 in MicroBlaze.


CODE
int32 fxmul32(int32 a, int32 b)
{
    int16 al, ah, bl, bh;
    int16 r1, r2, r3;
    
    al = a & 0xff;
    ah = (a >> 16) & 0xff;
    bl = b & 0xff;
    bh = (b >> 16) & 0xff;
    
    r1 = FXMUL16(ah, bh, FRACBITS-16);
    r2 = FXMUL16(ah, bl, FRACBITS-16);
    r3 = FXMUL16(al, bh, FRACBITS-16);
    
    return (((int16)r1 << 16) + (int16)r2 + (int16)r3);
}


Hope this helps.

Regards,

Mei
Go to the top of the page
 
+Quote Post
nelson
post Nov 17 2009, 12:51 PM
Post #3


Member
**

Group: Members
Posts: 7
Joined: 12-May 09
Member No.: 2,464



Hello Mei,
Thanks for the fxmul code.

Finished the tutorial, I don't receive anything from RS232 DTE port to hyperterminal.
I also send my project files to support@ImpulseAccelerated.com.

Regards

Jorge.

CODE
Xilinx Microprocessor Debugger (XMD) Engine
Xilinx EDK 11.3 Build EDK_LS3.57
Copyright © 1995-2009 Xilinx, Inc. All rights reserved.
Release 11.3 - psf2Edward EDK_LS3.57 (nt)
Copyright © 1995-2009 Xilinx, Inc. All rights reserved.

Checking platform configuration ...
IPNAME:plb_v46 INSTANCE:mb_plb -
C:\Impulse\CoDeveloper3\Examples\Embedded\ComplexFIR_MicroBlaze\EDK\system.mhs
line 66 - 2 master(s) : 3 slave(s)
IPNAME:lmb_v10 INSTANCE:ilmb -
C:\Impulse\CoDeveloper3\Examples\Embedded\ComplexFIR_MicroBlaze\EDK\system.mhs
line 73 - 1 master(s) : 1 slave(s)
IPNAME:lmb_v10 INSTANCE:dlmb -
C:\Impulse\CoDeveloper3\Examples\Embedded\ComplexFIR_MicroBlaze\EDK\system.mhs
line 80 - 1 master(s) : 1 slave(s)
IPNAME:fsl_v20 INSTANCE:fsl_v20_0 -
C:\Impulse\CoDeveloper3\Examples\Embedded\ComplexFIR_MicroBlaze\EDK\system.mhs
line 237 - 1 master(s) : 1 slave(s)
IPNAME:fsl_v20 INSTANCE:fsl_v20_1 -
C:\Impulse\CoDeveloper3\Examples\Embedded\ComplexFIR_MicroBlaze\EDK\system.mhs
line 244 - 1 master(s) : 1 slave(s)

Checking port drivers...
WARNING:EDK:2098 - PORT:IWAIT CONNECTOR:ilmb_LMB_Wait -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\microblaze_v7_20_c\data\mic

roblaze_v2_1_0.mpd line 234 - No driver found. Port will be driven to GND!
WARNING:EDK:2098 - PORT:DWAIT CONNECTOR:dlmb_LMB_Wait -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\microblaze_v7_20_c\data\mic

roblaze_v2_1_0.mpd line 270 - No driver found. Port will be driven to GND!
WARNING:EDK:2098 - PORT:bscan_tdo1 CONNECTOR:bscan_tdo1 -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\mdm_v1_00_f\data\mdm_v2_1_0

.mpd line 230 - No driver found. Port will be driven to GND!
WARNING:EDK:2099 - PORT:I_ADDRTAG CONNECTOR:ilmb_M_ADDRTAG -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\microblaze_v7_20_c\data\mic

roblaze_v2_1_0.mpd line 232 - floating connection!
WARNING:EDK:2099 - PORT:D_ADDRTAG CONNECTOR:dlmb_M_ADDRTAG -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\microblaze_v7_20_c\data\mic

roblaze_v2_1_0.mpd line 273 - floating connection!
WARNING:EDK:2099 - PORT:FSL0_M_CLK CONNECTOR:fsl_v20_0_FSL_M_Clk -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\microblaze_v7_20_c\data\mic

roblaze_v2_1_0.mpd line 375 - floating connection!
WARNING:EDK:2099 - PORT:FSL1_S_CLK CONNECTOR:fsl_v20_1_FSL_S_Clk -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\microblaze_v7_20_c\data\mic

roblaze_v2_1_0.mpd line 380 - floating connection!
WARNING:EDK:2099 - PORT:bscan_tdi CONNECTOR:bscan_tdi -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\mdm_v1_00_f\data\mdm_v2_1_0

.mpd line 223 - floating connection!
WARNING:EDK:2099 - PORT:bscan_reset CONNECTOR:bscan_reset -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\mdm_v1_00_f\data\mdm_v2_1_0

.mpd line 224 - floating connection!
WARNING:EDK:2099 - PORT:bscan_shift CONNECTOR:bscan_shift -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\mdm_v1_00_f\data\mdm_v2_1_0

.mpd line 225 - floating connection!
WARNING:EDK:2099 - PORT:bscan_update CONNECTOR:bscan_update -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\mdm_v1_00_f\data\mdm_v2_1_0

.mpd line 226 - floating connection!
WARNING:EDK:2099 - PORT:bscan_capture CONNECTOR:bscan_capture -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\mdm_v1_00_f\data\mdm_v2_1_0

.mpd line 227 - floating connection!
WARNING:EDK:2099 - PORT:bscan_sel1 CONNECTOR:bscan_sel1 -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\mdm_v1_00_f\data\mdm_v2_1_0

.mpd line 228 - floating connection!
WARNING:EDK:2099 - PORT:bscan_drck1 CONNECTOR:bscan_drck1 -
c:\Xilinx\11.1\EDK\hw\XilinxProcessorIPLib\pcores\mdm_v1_00_f\data\mdm_v2_1_0

.mpd line 229 - floating connection!
WARNING:EDK:2099 - PORT:FSL0_S_Clk CONNECTOR:fsl_v20_0_FSL_S_Clk -
C:\Impulse\CoDeveloper3\Examples\Embedded\ComplexFIR_MicroBlaze\EDK\pcores\fs

l_filt_v1_00_a\data\fsl_filt_v2_1_0.mpd line 13 - floating connection!
WARNING:EDK:2099 - PORT:FSL1_M_Clk CONNECTOR:fsl_v20_1_FSL_M_Clk -
C:\Impulse\CoDeveloper3\Examples\Embedded\ComplexFIR_MicroBlaze\EDK\pcores\fs

l_filt_v1_00_a\data\fsl_filt_v2_1_0.mpd line 18 - floating connection!

Performing Clock DRCs...

Performing Reset DRCs...

Overriding system level properties...

Running system level update procedures...

Running UPDATE Tcl procedures for OPTION SYSLEVEL_UPDATE_PROC...

Running system level DRCs...

Performing System level DRCs on properties...

Running DRC Tcl procedures for OPTION SYSLEVEL_DRC_PROC...

XMD%
Info:AutoDetecting cable. Please wait.
Info:Connecting to cable (Usb Port - USB21).
Info:Checking cable driver.
Info: Driver file xusb_emb.sys found.
Info: Driver version: src=1029, dest=1029.
Info: Driver windrvr6.sys version = 8.1.1.0.Info: WinDriver v8.11 Jungo © 1997
- 2006 Build Date: Oct 16 2006 X86 32bit SYS 12:35:07, version = 811.
Info: Cable PID = 0008.
Info: Max current requested during enumeration is 74 mA.
Info:Type = 0x0004.
Info: Cable Type = 3, Revision = 0.
Info: Setting cable speed to 6 MHz.
Info:Cable connection established.
Info:Firmware version = 1303.
Info:File version of c:/Xilinx/11.1/ISE/data/xusb_xlp.hex = 1303.
Info:Firmware hex file version = 1303.
Info:PLD file version = 0012h.
Info: PLD version = 0012h.
Info:Type = 0x0004.
Info: ESN device is not available for this cable.

JTAG chain configuration
--------------------------------------------------
Device ID Code IR Length Part Name
1 01c22093 6 XC3S500E
2 f5046093 8 XCF04S
3 06e5e093 8 XC2C64A

MicroBlaze Processor Configuration :
-------------------------------------
Version............................7.20.c
Optimization.......................Area
Interconnect.......................PLBv46
MMU Type...........................No_MMU
No of PC Breakpoints...............1
No of Read Addr/Data Watchpoints...0
No of Write Addr/Data Watchpoints..0
Instruction Cache Support..........on
Instruction Cache Base Address.....0x44000000
Instruction Cache High Address.....0x47ffffff
Data Cache Support.................on
Data Cache Base Address............0x44000000
Data Cache High Address............0x47ffffff
Exceptions Support................off
FPU Support.......................off
Hard Divider Support...............off
Hard Multiplier Support............on - (Mul32)
Barrel Shifter Support.............off
MSR clr/set Instruction Support....on
Compare Instruction Support........on
Number of FSL ports................2
Extended FSL Support...............off
Data Cache Write-back Support......off

Connected to "mb" target. id = 0
Starting GDB server for "mb" target (id = 0) at TCP port no 1234
XMD% dow ComplexFIR/executable.elf
System Reset .... DONE
Downloading Program -- ComplexFIR/executable.elf
section, .vectors.reset: 0x00000000-0x00000007
section, .vectors.sw_exception: 0x00000008-0x0000000f
section, .vectors.interrupt: 0x00000010-0x00000017
section, .vectors.hw_exception: 0x00000020-0x00000027
section, .text: 0x44000000-0x44003c0b
section, .init: 0x44003c0c-0x44003c2f
section, .fini: 0x44003c30-0x44003c4b
section, .rodata: 0x44003c4c-0x440053f1
section, .data: 0x440053f4-0x44005923
section, .ctors: 0x44005924-0x4400592b
section, .dtors: 0x4400592c-0x44005933
section, .eh_frame: 0x44005934-0x44005937
section, .jcr: 0x44005938-0x4400593b
section, .sbss: 0x4400593c-0x4400593f
section, .bss: 0x44005940-0x4400780b
section, .heap: 0x4400780c-0x4404780f
section, .stack: 0x44047810-0x4408780f
Setting PC with Program Start Address 0x00000000

XMD% con
Info:Processor started. Type "stop" to stop processor

RUNNING> XMD%
Go to the top of the page
 
+Quote Post
tadeu
post Jan 12 2010, 09:51 AM
Post #4


Newbie
*

Group: Members
Posts: 1
Joined: 11-January 10
Member No.: 2,579



Hi, same problem here. I finished a design but had no response from RS232 port.

Any help would be greatly appreciated.
Go to the top of the page
 
+Quote Post
meix
post Jan 13 2010, 09:20 AM
Post #5


Advanced Member
***

Group: Impulse Staff
Posts: 32
Joined: 7-May 07
Member No.: 1,338



Hi Nelson,

Sorry for the late response. I didn't receive your code in last November. Could you please resend the EDK project files to support@impulsec.com?

Thanks,

Meix
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 30th July 2010 - 06:14 AM