Hello,
I am trying to run a basic DPI example.
Code C - [expand] |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| ====================================
=========SV FILE top.sv ==============
module top;
import "DPI-C" string_sv2c=function void string_sv2c();
initial
begin
string_sv2c();
end
endmodule
===================================
===================================
===================================
======== C FILE main.c ==============
#include "stdio.h"
#include "dpi_header.h"
#include "svdpi.h"
void string_sv2c(){
printf(" C: Hellow from C ");
} |
==================================
==================================
I am using below commands to simulate :
Code dot - [expand] |
1
2
3
| vlib work
vlog -dpi_header dpi_header.h top.sv main.c
vism -c work.main -do "run -all" |
BELOW IS THE SIMULATION REPORT :
Code dot - [expand] |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| Reading pref.tcl
# 10.2c
# vsim -do {run -all} -c work.main
# ** Note: (vsim-3812) Design is being optimized...
# ** Error: Failed to find design unit work.main.
# Optimization failed
# Error loading design
Error loading design |
Can somebody please tell me what wrong I am doing ??
If I am using wrong commands, then please provide me the correct commands.
Thanks
Shiladitya
Last edited by a moderator: