Memory and pipes


#1

Hi

I am trying to use the pipes in/out function. In my program, I send
Airborne Hydrography (ie my company)
but receive hyhyhyhyhyhyhyhyhyhy

I think this is due problem with the ram that is used in the pipe example.

I use
ram_I : RAMB16_S18_S18 port map(
CLKA => ti_clk, SSRA => count_reset, ENA => ‘1’,
WEA => pipeI_write, ADDRA => count_pipeI(9 downto 0),
DIA => pipeI_data, DIPA => “00”,
CLKB => ti_clk, SSRB => count_reset, ENB => ‘1’,
WEB => ‘0’, ADDRB => count_pipeO(9 downto 0),
DIB => x"0000", DIPB => “00”, DOB => pipeA1_data);

Where to I find this component? It’s only a red ? in my “Sorces in Project”-window

I also get these warnings:

Unit okHI/hicore: the following tristate(s) are NOT replaced by logic (Please refer to Answer Record 20048 for more information): ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data.
WARNING:Xst:2183 - Unit epB0: the following tristate(s) are NOT replaced by logic (Please refer to Answer Record 20048 for more information): ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data.
WARNING:Xst:2183 - Unit epA1: the following tristate(s) are NOT replaced by logic (Please refer to Answer Record 20048 for more information): ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data, ti_data.
and so on for som other unit ep…
Xst:1336 - (*) More than 100% of Device resources are used

The problem seem to be the tristate2logic= yes/no but I can’t find this option. I am using Xilinx project navigation


#2

Hi Rick-

I think you can safely ignore those warnings. As Xilinx changes their ISE software, new warnings seem to pop up from time to time. I’ll look into them to see if there’s a way to remove them.

The RAMB16_S18_S18 block is a standard Xilinx logic block that will come from the standard libraries. I’m not sure why it wouldn’t be found. Is it found for the PipeTest sample?


#3

I’ve been searching for RAMB16_S18_S18 block on both the installed files and on xilinx homepage and I can only find a verilog file. Is this file used in the pipe sample? I get errors when I try to synthesize.

Do you know where to find this vhdl file? (although this should be asked to xilinx, but since you’ve been very helpful and fast to reply, I ask you)


#4

The problem that I can only send/receive 2 bytes may be due to to pipe. Example send 1234, receive 3434

I tried to use buffered pipes instead by replacing the connections in the ram:
ram_I : RAMB16_S18_S18 port map(
CLKA => ti_clk, SSRA => count_reset, ENA => ‘1’,
WEA => bpi_read, ADDRA => count_pipeI(9 downto 0),
DIA => ep30wire, DIPA => “00”,
CLKB => ti_clk, SSRB => count_reset, ENB => ‘1’,
WEB => ‘0’, ADDRB => count_pipeO(9 downto 0),
DIB => x"0000", DIPB => “00”, DOB => ep10wire );
However, this did return the correct number of bytes but not the message

Another question. how to download the fpga bit file into the fpga by using the c++ program? I’m currently using front panel to download the bit file.


#5

I got the memory to function correctly, but I still have a problem. I want to program the FPGA from the c++ program, but I can’t declare a string when using the libraries to handle the FPGA. ex std::string str; will not work

I’m using visual studio 6.0 with the latest library. Here’s an example from my code:
okCUsbXEM3001v2 comUSBDriver;
a=comUSBDriver.ConfigureFPGA(“P:\Misc\Datakort\datakort\datakort.bit”);

the error messages are:
msvcprt.lib(MSVCP60.dll) : error LNK2005: “public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)” (??1?$basic_string@
DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in libcpd.lib(string.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: “public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::assign(class s
td::basic_string,class std::allocator > const &,unsigned int,unsigned int)” (?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z) already defined in libcpd.lib(string.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: “public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(class basic_string,class std::allocator >::basic_string,class std::allocator > const &)” (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in libcpd.
lib(string.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: “private: bool __thiscall std::basic_string,class std::allocator >::_Grow(unsigned int,bool)” (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAE
_NI_N@Z) already defined in DatakortConsole.obj

I don’t know how to get past this, but there seems to some problem with the libraries. Suggestions?


#6

Hi Rick-

This problem fits a general class of problems where a single library is linked at multiple points during a build. Depending on what libraries you link against (ours and others), it has different solutions.

I suggest trying to tell MSVC not to link your application with the errant libraries and see if that works. Our C++ lib uses STL (std::string and others) and we’ve compiled final applications that use STL, so this problem seems to be in the way you have MSVC setup.

Perhaps others have seen this same warning? Anyone??


#7

Ok I understand the problem, but I haven’t managed to fix it.
My includes are:
#include “stdafx.h”
#include “okCUsbFrontPanel.h”
#include “okCPLL22150.h”
#include “windows.h”
#include
#include
#include
#include

Ignored libraries are:
LIBCD.lib msvcprt.lib MSVCRT.lib libcpd.lib libcmt.lib

And I get errors:
msvcprt.lib(MSVCP60.dll) : error LNK2005: “public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)” (??1?$basic_string@
DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in libcpd.lib(string.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: “public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::assign(class s
td::basic_string,class std::allocator > const &,unsigned int,unsigned int)” (?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z) already defined in libcpd.lib(string.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: “public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(class basic_string,class std::allocator >::basic_string,class std::allocator > const &)” (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in libcpd.
lib(string.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: “private: bool __thiscall std::basic_string,class std::allocator >::_Grow(unsigned int,bool)” (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAE
_NI_N@Z) already defined in DatakortConsole.obj
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __close already defined in LIBCD.lib(close.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __lseek already defined in LIBCD.lib(lseek.obj)
LINK : warning LNK4098: defaultlib “MSVCRT” conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib “LIBCMT” conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/DatakortConsole.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

Anyone seen the same problem? Or have any solution?


#8

Are you sure those libraries are being ignored? Your output includes:

LINK : warning LNK4098: defaultlib “MSVCRT” conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib “LIBCMT” conflicts with use of other libs; use /NODEFAULTLIB:library

Which indicates to me that they aren’t. Check the linker command line to see that those commands are being inserted.


#9

My mistake, a syntax error in ignoring libs! So now I can compile the file and it works. Thanks!


#10

Do the other applications (pipetest, FrontPanel) configure the same board properly with the same bitfile?

Is the full path to the file provided? Visual Studio runs the executable from the “Release” or “Debug” directory, but sets the active directory to the project directory.


#11

The compiling works just fine, but I have a question regarding the interface to the memory RAMB16_S18_S18. I want to put data in the memory by the FPGA and read from the pipe via USB.
I guess to write to memory A:
CLKA = clock, WEA = 1, SSRA = 0, DIA = data to write, ADDRA = address to write, ENA =1, DIPA = “00” and the memory should be written at every positive flank. The doesn’t seem to work, and since you are using the interface in pipe I wonder if I have made something wrong.