Forum Discussion
Ric2
New Contributor
2 years agoDeadlock while filling pipe for simulation
Hi, following best practice as descibed here we run into trouble with stalled writes. When you create a testbench for a oneAPI kernel that you intend to compile as an IP core, write all your data...
Kevin_Xu_Intel
New Contributor
2 years agoHi Ric,
I have simulated you reproducer a several times, here are what i found:
- I see your issue number (1) where when a non-blocking pipe write is writing into a pipe that has hit the implicit capacity, the write failed signal isn't being raised. I will ask around if this is a known behaviors.
- I don't really see issue (2). The data seems to be processed in burst for me (about every ~17000) but it eventually reach the end (see the output). The simulation dose took about 1 hour with ModelSim pro. So if you are simulating with a starter edition, it is going to take very long time to simulate (may appears to be stalled).
- "vsimk: src/hls_cosim_ipc_socket.cpp:133: virtual void IPCSocket::send(const void*, int): Assertion `0 && "send() failed"' failed" I believe this is the expected error when stopping simulation with ctrl+C.
Simulation output (only shown the begining and the end)
Running on device: SimulatorDevice : Multi-process Simulator (aclmsim0) WR ... Input: 0 Output: 0 Diff: 0 RD STALL WORKS! WR ... Input: 1000 Output: 0 Diff: 1000 RD ... Input: 1274 Output: 0 Diff: 1274 WR ... Input: 2000 Output: 41 Diff: 1959 WR ... Input: 3000 Output: 99 Diff: 2901 WR ... Input: 4000 Output: 156 Diff: 3844 WR ... Input: 5000 Output: 222 Diff: 4778 WR ... Input: 6000 Output: 292 Diff: 5708 WR ... Input: 7000 Output: 366 Diff: 6634 WR ... Input: 8000 Output: 438 Diff: 7562 WR ... Input: 9000 Output: 513 Diff: 8487 WR ... Input: 10000 Output: 588 Diff: 9412 WR ... Input: 11000 Output: 662 Diff: 10338 WR ... Input: 12000 Output: 735 Diff: 11265 WR ... Input: 13000 Output: 809 Diff: 12191 WR ... Input: 14000 Output: 882 Diff: 13118 WR ... Input: 15000 Output: 955 Diff: 14045 RD ... Input: 15623 Output: 1000 Diff: 14623 WR ... Input: 16000 Output: 1029 Diff: 14971 WR ... Input: 17000 Output: 1097 Diff: 15903 WR ... Input: 18000 Output: 1159 Diff: 16841 ... ... WR ... Input: 982000 Output: 952124 Diff: 29876 RD ... Input: 982875 Output: 953000 Diff: 29875 WR ... Input: 983000 Output: 953126 Diff: 29874 RD ... Input: 983859 Output: 954000 Diff: 29859 WR ... Input: 984000 Output: 954142 Diff: 29858 RD ... Input: 984858 Output: 955000 Diff: 29858 WR ... Input: 985000 Output: 955143 Diff: 29857 RD ... Input: 985857 Output: 956000 Diff: 29857 WR ... Input: 986000 Output: 956147 Diff: 29853 RD ... Input: 986853 Output: 957000 Diff: 29853 WR ... Input: 987000 Output: 957148 Diff: 29852 RD ... Input: 987852 Output: 958000 Diff: 29852 WR ... Input: 988000 Output: 958149 Diff: 29851 RD ... Input: 988852 Output: 959000 Diff: 29852 WR ... Input: 989000 Output: 959150 Diff: 29849 RD ... Input: 989835 Output: 960000 Diff: 29835 WR ... Input: 990000 Output: 960166 Diff: 29834 RD ... Input: 990822 Output: 961000 Diff: 29822 WR ... Input: 991000 Output: 961178 Diff: 29822 RD ... Input: 991823 Output: 962000 Diff: 29823 WR ... Input: 992000 Output: 962178 Diff: 29822 RD ... Input: 992823 Output: 963000 Diff: 29823 WR ... Input: 993000 Output: 963179 Diff: 29821 RD ... Input: 993823 Output: 964000 Diff: 29823 WR ... Input: 994000 Output: 964177 Diff: 29823 RD ... Input: 994822 Output: 965000 Diff: 29822 WR ... Input: 995000 Output: 965179 Diff: 29821 RD ... Input: 995810 Output: 966000 Diff: 29810 WR ... Input: 996000 Output: 966199 Diff: 29801 RD ... Input: 996802 Output: 967000 Diff: 29802 WR ... Input: 997000 Output: 967198 Diff: 29802 RD ... Input: 997804 Output: 968000 Diff: 29804 WR ... Input: 998000 Output: 968197 Diff: 29803 RD ... Input: 998804 Output: 969000 Diff: 29804 WR ... Input: 999000 Output: 969197 Diff: 29803 RD ... Input: 999807 Output: 970000 Diff: 29807 Input Done! RD ... Input: 1000000 Output: 971000 Diff: 29000 RD ... Input: 1000000 Output: 972000 Diff: 28000 RD ... Input: 1000000 Output: 973000 Diff: 27000 RD ... Input: 1000000 Output: 974000 Diff: 26000 RD ... Input: 1000000 Output: 975000 Diff: 25000 RD ... Input: 1000000 Output: 976000 Diff: 24000 RD ... Input: 1000000 Output: 977000 Diff: 23000 RD ... Input: 1000000 Output: 978000 Diff: 22000 RD ... Input: 1000000 Output: 979000 Diff: 21000 RD ... Input: 1000000 Output: 980000 Diff: 20000 RD ... Input: 1000000 Output: 981000 Diff: 19000 RD ... Input: 1000000 Output: 982000 Diff: 18000 RD ... Input: 1000000 Output: 983000 Diff: 17000 RD ... Input: 1000000 Output: 984000 Diff: 16000 RD ... Input: 1000000 Output: 985000 Diff: 15000 RD ... Input: 1000000 Output: 986000 Diff: 14000 RD ... Input: 1000000 Output: 987000 Diff: 13000 RD ... Input: 1000000 Output: 988000 Diff: 12000 RD ... Input: 1000000 Output: 989000 Diff: 11000 RD ... Input: 1000000 Output: 990000 Diff: 10000 RD ... Input: 1000000 Output: 991000 Diff: 9000 RD ... Input: 1000000 Output: 992000 Diff: 8000 RD ... Input: 1000000 Output: 993000 Diff: 7000 RD ... Input: 1000000 Output: 994000 Diff: 6000 RD ... Input: 1000000 Output: 995000 Diff: 5000 RD ... Input: 1000000 Output: 996000 Diff: 4000 RD ... Input: 1000000 Output: 997000 Diff: 3000 RD ... Input: 1000000 Output: 998000 Diff: 2000 RD ... Input: 1000000 Output: 999000 Diff: 1000 Output Done! FAILED
Ric2
New Contributor
2 years agoHi,
thanks for having a look at the issues!
CPU speed will have influence on the issue generation (RAM size might be too), so for your machine the settings for reproduction might be different. When I set the gap number e.g. 5000 it runs through w/o issues on my machine too. So on you machine you need to set it higher, try 30000.
b.t.w. the full error I see is:
vsimk: src/hls_cosim_ipc_socket.cpp:133: virtual void IPCSocket::send(const void*, int): Assertion `0 && "send() failed"' failed. # Attempting stack trace sig 6 # Signal caught: signo [0] # vsim_stacktrace.vstf written # Current time Mon Jun 17 16:48:02 2024 # Program = vsim # Id = "2023.2" # Version = "2023.04" # Date = "Apr 11 2023" # Platform = "linux_x86_64" # Signature = 016838926890ae993a152c369dc4c1be # --> START OF USERCODE # 0 0x00007ffff78969fc: 'pthread_kill + 0x000000000000012c' in '/usr/lib/x86_64-linux-gnu/libc.so.6' # 1 0x00007ffff7842476: 'raise + 0x0000000000000016' in '/usr/lib/x86_64-linux-gnu/libc.so.6' # 2 0x00007ffff78287f3: 'abort + 0x00000000000000d3' in '/usr/lib/x86_64-linux-gnu/libc.so.6' # <-- END OF USERCODE # 3 0x00007ffff782871b: '<unknown (@0x7ffff782871b)>' # 4 0x00007ffff7839e96: '<unknown (@0x7ffff7839e96)>' # 5 0x00007ffff2818321: '<unknown (@0x7ffff2818321)>' # --> START OF USERCODE # 6 0x00007ffff2806c1b: 'SimulatorInterface::send_host_channel(void*, void*, bool*, bool*, unsigned int*) + 0x000000000000015b' in '/data1/intel/oneapi/compiler/2024.1/opt/oclfpga/host/linux64/lib/libaoc_cosim_msim.so' # <-- END OF USERCODE # 7 0x00007feff1fc4f1f: '../../ip/mpsim/dpic_Threshold/aoc_sim_component_dpi_controller_10/sim/aoc_sim_stream_sink_dpi_bfm.sv:38' # 8 0x00007feff1fc65ef: '../../ip/mpsim/dpic_Threshold/aoc_sim_component_dpi_controller_10/sim/aoc_sim_stream_sink_dpi_bfm.sv:70' # 9 0x00007feff1fc77ce: '../../ip/mpsim/dpic_Threshold/aoc_sim_component_dpi_controller_10/sim/aoc_sim_stream_sink_dpi_bfm.sv:185' # 10 0x00000000023e53b2: '<unknown (@0x23e53b2)>' # 11 0x00000000004df304: '<unknown (@0x4df304)>' # 12 0x000000000074da63: '<unknown (@0x74da63)>' # 13 0x0000000000ca58ad: '<unknown (@0xca58ad)>' # 14 0x0000000000caabd0: '<unknown (@0xcaabd0)>' # 15 0x0000000000cac54e: '<unknown (@0xcac54e)>' # 16 0x0000000000f9bd2d: '<unknown (@0xf9bd2d)>' # 17 0x000000000287a82d: '<unknown (@0x287a82d)>' # 18 0x000000000287ec86: '<unknown (@0x287ec86)>' # 19 0x0000000002880371: '<unknown (@0x2880371)>' # 20 0x00000000028806d6: '<unknown (@0x28806d6)>' # 21 0x0000000002881df3: '<unknown (@0x2881df3)>' # 22 0x00000000028825b1: '<unknown (@0x28825b1)>' # 23 0x0000000000c6c700: '<unknown (@0xc6c700)>' # 24 0x0000000000c6e315: '<unknown (@0xc6e315)>' # End of Stack Trace
o