fix for dpi_export_unpack
This commit is contained in:
parent
de0236be2f
commit
1b847340e0
|
|
@ -325,3 +325,4 @@ Yogish Sekhar
|
||||||
24bit-xjkp
|
24bit-xjkp
|
||||||
Zubin Jain
|
Zubin Jain
|
||||||
Muzaffer Kal
|
Muzaffer Kal
|
||||||
|
Yilin Li
|
||||||
|
|
|
||||||
|
|
@ -463,7 +463,9 @@ void EmitCFunc::emitVarReset(const string& prefix, AstVar* varp, bool constructi
|
||||||
// 'constructing' indicates that the object was just constructed, so if it is a string or
|
// 'constructing' indicates that the object was just constructed, so if it is a string or
|
||||||
// something that starts off clear already, no need to clear it again
|
// something that starts off clear already, no need to clear it again
|
||||||
AstNodeDType* const dtypep = varp->dtypep()->skipRefp();
|
AstNodeDType* const dtypep = varp->dtypep()->skipRefp();
|
||||||
const string vlSelf = VSelfPointerText::replaceThis(m_useSelfForThis, "this->");
|
const string vlSelf = m_cfuncp && m_cfuncp->isStatic() ?
|
||||||
|
"vlSymsp->TOP__" + m_modp->name() + "." :
|
||||||
|
VSelfPointerText::replaceThis(m_useSelfForThis, "this->");
|
||||||
const string varNameProtected
|
const string varNameProtected
|
||||||
= ((VN_IS(m_modp, Class) || varp->isFuncLocal()) || !prefix.empty())
|
= ((VN_IS(m_modp, Class) || varp->isFuncLocal()) || !prefix.empty())
|
||||||
? varp->nameProtect()
|
? varp->nameProtect()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# DESCRIPTION: Verilator: Verilog Test for dpi unpack array
|
||||||
|
#
|
||||||
|
# author: Yilin Li
|
||||||
|
|
||||||
|
import vltest_bootstrap
|
||||||
|
|
||||||
|
test.scenarios('simulator')
|
||||||
|
|
||||||
|
test.compile(verilator_flags2=["--binary"])
|
||||||
|
|
||||||
|
test.execute()
|
||||||
|
|
||||||
|
test.passes()
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
export "DPI-C" task readHEX;
|
||||||
|
export "DPI-C" task loadHEX;
|
||||||
|
|
||||||
|
task readHEX;
|
||||||
|
input string file;
|
||||||
|
output logic [7:0] stimuli[32'h00010000];
|
||||||
|
$readmemh(file, stimuli);
|
||||||
|
endtask
|
||||||
|
|
||||||
|
task loadHEX;
|
||||||
|
input string file;
|
||||||
|
logic [7:0] stimuli[32'h00010000];
|
||||||
|
readHEX(file, stimuli);
|
||||||
|
endtask
|
||||||
|
|
||||||
|
module tb();
|
||||||
|
|
||||||
|
logic [7:0] result[32'h00010000];
|
||||||
|
initial begin
|
||||||
|
loadHEX("dummy");
|
||||||
|
end
|
||||||
|
|
||||||
|
endmodule
|
||||||
Loading…
Reference in New Issue