From a0c2413b85e01f23d25788a9f76a829962461102 Mon Sep 17 00:00:00 2001 From: "(Tim) Efthymios Kritikos" Date: Mon, 6 Feb 2023 15:42:39 +0000 Subject: [PATCH] First try at the Verilog VPI --- verilog_iverilog/VPI_example/Makefile | 15 +++++++++ verilog_iverilog/VPI_example/hello.c | 41 +++++++++++++++++++++++++ verilog_iverilog/VPI_example/hello.o | Bin 0 -> 22192 bytes verilog_iverilog/VPI_example/hello.v | 9 ++++++ verilog_iverilog/VPI_example/hello.vpi | Bin 0 -> 20328 bytes verilog_iverilog/VPI_example/hello.vvp | 24 +++++++++++++++ 6 files changed, 89 insertions(+) create mode 100644 verilog_iverilog/VPI_example/Makefile create mode 100644 verilog_iverilog/VPI_example/hello.c create mode 100644 verilog_iverilog/VPI_example/hello.o create mode 100644 verilog_iverilog/VPI_example/hello.v create mode 100755 verilog_iverilog/VPI_example/hello.vpi create mode 100755 verilog_iverilog/VPI_example/hello.vvp diff --git a/verilog_iverilog/VPI_example/Makefile b/verilog_iverilog/VPI_example/Makefile new file mode 100644 index 0000000..7b09e7e --- /dev/null +++ b/verilog_iverilog/VPI_example/Makefile @@ -0,0 +1,15 @@ +OBJECTS= hello.vvp hello.o +CFLAGS = -Wall -O $(CFLAGS_$@) + + +simulate: ${OBJECTS} + vvp -M. -mhello hello.vvp + +%.o:%.c + iverilog-vpi $< --name $(subst .o,,$@) + +%.vvp:%.v + iverilog $^ -o $@ + +clean: + rm ${OBJECTS} -f diff --git a/verilog_iverilog/VPI_example/hello.c b/verilog_iverilog/VPI_example/hello.c new file mode 100644 index 0000000..64aa6e2 --- /dev/null +++ b/verilog_iverilog/VPI_example/hello.c @@ -0,0 +1,41 @@ +#include + +static int hello_compiletf(char* user_data){ + return 0; +} + +static int hello_calltf(char* user_data){ + vpiHandle systfref, args_iter, argh; + struct t_vpi_value argval; + int value; + + // Obtain a handle to the argument list + systfref = vpi_handle(vpiSysTfCall, NULL); + args_iter = vpi_iterate(vpiArgument, systfref); + + // Grab the value of the first argument + argh = vpi_scan(args_iter); + argval.format = vpiIntVal; + vpi_get_value(argh, &argval); + value = argval.value.integer; + vpi_printf("Hello World!\nVPI routine received %d\n", value); + + return 0; +} + +void hello_register(){ + s_vpi_systf_data tf_data; + + tf_data.type = vpiSysTask; + tf_data.tfname = "$hello"; + tf_data.calltf = hello_calltf; + tf_data.compiletf = hello_compiletf; + tf_data.sizetf = 0; + tf_data.user_data = 0; + vpi_register_systf(&tf_data); +} + +void (*vlog_startup_routines[])() = { + hello_register, + 0 +}; diff --git a/verilog_iverilog/VPI_example/hello.o b/verilog_iverilog/VPI_example/hello.o new file mode 100644 index 0000000000000000000000000000000000000000..1e57f70a125dbb4a8dc7438411cf6caa03d430ea GIT binary patch literal 22192 zcmeHv2UHZxyJz<#a?U{+a!{g(iXuToP*f05F~I;skYT`?0RaPuieSVXKt;hUDh5aWS^8yvtQNdgCw=uNbx zFiH?Rg4$>wiu57ei7vzkjgH@3Ymdfjm`$Tlm=2uU6c{*1ZyW&P0%vio?En#2=x^2C zwKi}L7mCFPYKV^n7CwWhBEYIzT3R4>@&v~U<{o&$--=HOYKZD!0-7K+?ES4YpF=8e z7O)l<*on5C&JCPeA9$4Fp#1GzKOc?&g1_W%=vqt39FBx03XjvK3QwT;Daf2hacE?g z%t{fK*b86;Ed#POY|B;waHrPW(HS?f34%+IicnY`-a5b=4qQbANOC!JM2m4*CUe-yk)r){ z27_3WqWe&^Aw~OBG@qjTTJ{IA9iegoSYu^_8)XcF9C#yG+u^MzAgM}m1K3cKDvsgM z5&%OXB3iCE0_~*$;V6qz#}hFWO&2Ft9g1s$M&m#gRy0Uab`-}pU^~fjc9IQX6*&ZJ zBNkK@w_w3kT2NW)LZne7M_KAhr0GEwMS^t!$Z0EbvlJ3o1fe69NeFJXmKgA;KANBj z#VB%O8#zf0mXAUw8YnD@o+>?5f^@p8fTC#-D&~qoI$+%DL!JuF z0ww1X5an7CDk{BI*x>2F`$ZY#=uR2qVGTtclC7?yLYp_&B!RY)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tWs32o?fs|C+jj7K9!0+@YA$`1G!4{bMR_*9- zK>8_I5yedXzU}DiqRrRsf6-5DNB=F-hwr-N12g~G?dU70(OO3G%7A9-SGJ?iNBVfY zVKYqq^X=%{A$?zl0wYO$Z%01~{ult^iTq{^q?!6wfRC_TD38M+Et?M*dU6T`cvA`KY{dD|BL>{cJ$+QX+_h2(Ld3Sejd`VK=T-zVV3_{JNnLMv<7}p z)t){)FF-bPu?&n2`E&|(1DybOX8w-t=-VTG9fkrUN%TVcXt`_6rfA{>i>q$%CbsDZ;d~o6XG42mA zToypKhFp}t16s#0gDIQTPX0b9f7*c?d?^DASb&R}Km0w#vPR#j(^>Dlo>C2Z9(kGEV6UTZOKMC~V9A^x(R((DeL@{nZ4Btoj zGxeXN{1dTYJNoea@OSe!voEa>i1gt2aRwL8AJ1P{A7PuF`KApnroIxu hKoR~C-ogw)I7&yYcV_!(0nYFAYf<_CVlbKd{{@}SO~3#E literal 0 HcmV?d00001 diff --git a/verilog_iverilog/VPI_example/hello.v b/verilog_iverilog/VPI_example/hello.v new file mode 100644 index 0000000..ed77418 --- /dev/null +++ b/verilog_iverilog/VPI_example/hello.v @@ -0,0 +1,9 @@ +module main; +integer val; + +initial begin + val = 41; + $hello(val); +end + +endmodule diff --git a/verilog_iverilog/VPI_example/hello.vpi b/verilog_iverilog/VPI_example/hello.vpi new file mode 100755 index 0000000000000000000000000000000000000000..c90ff49e9c28acee2614fefd6f33735a4b09b936 GIT binary patch literal 20328 zcmeHPdvILkb^q?&y{naEJ?xciNw%Z4k--Lb^}zUnZM=HfE3iR;L@u-e`3 z-nA{afWV}|mxKr@#l}5sLD)7? zkM#!8C2igFs!O=G8XICNnr)f-Fo;#Mlm1G#?U=Hj{A7QATQ3~6MQf+NJ!M%31)s z?Z;N^H|cLw`SqwooOGw^k16+e3;d`q|I^01`Bv56Qv1QHwwtLcudFA$7LCBxOvRJ>zmcYlCz^?}G z$Kq^z0IYX{kWXP*F51Ls$X0R=&p=!u8bwZR#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