forked from github/verilator
Untabify
This commit is contained in:
parent
003a8cfe75
commit
cfe0fdd5cc
@ -400,8 +400,8 @@ accesses the above signal "readme" would be:
|
|||||||
vpiHandle vh1 = vpi_handle_by_name((PLI_BYTE8*)"TOP.our.readme", NULL);
|
vpiHandle vh1 = vpi_handle_by_name((PLI_BYTE8*)"TOP.our.readme", NULL);
|
||||||
if (!vh1) vl_fatal(__FILE__, __LINE__, "sim_main", "No handle found");
|
if (!vh1) vl_fatal(__FILE__, __LINE__, "sim_main", "No handle found");
|
||||||
const char* name = vpi_get_str(vpiName, vh1);
|
const char* name = vpi_get_str(vpiName, vh1);
|
||||||
const char* type = vpi_get_str(vpiType, vh1);
|
const char* type = vpi_get_str(vpiType, vh1);
|
||||||
const int size = vpi_get(vpiSize, vh1);
|
const int size = vpi_get(vpiSize, vh1);
|
||||||
printf("register name: %s, type: %s, size: %d\n", name, type, size); // Prints "register name: readme, type: vpiReg, size: 32"
|
printf("register name: %s, type: %s, size: %d\n", name, type, size); // Prints "register name: readme, type: vpiReg, size: 32"
|
||||||
|
|
||||||
s_vpi_value v;
|
s_vpi_value v;
|
||||||
|
@ -10,7 +10,7 @@ module t (/*AUTOARG*/);
|
|||||||
e0,
|
e0,
|
||||||
e1,
|
e1,
|
||||||
e2,
|
e2,
|
||||||
e3
|
e3
|
||||||
} EN;
|
} EN;
|
||||||
|
|
||||||
initial begin
|
initial begin
|
||||||
|
@ -52,7 +52,7 @@ if (!-r catfile($root, ".git")) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (keys %names) {
|
if (keys %names) {
|
||||||
error("Files like stdint.h instead of cstdint:\n ", join("\n ", sort keys %names));
|
error("Files like stdint.h instead of cstdint:\n ", join("\n ", sort keys %names));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,9 +10,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
|
|||||||
|
|
||||||
scenarios(simulator => 1);
|
scenarios(simulator => 1);
|
||||||
|
|
||||||
compile(
|
compile();
|
||||||
fails=>0,
|
|
||||||
);
|
|
||||||
|
|
||||||
ok(1);
|
ok(1);
|
||||||
1;
|
1;
|
||||||
|
@ -7,48 +7,50 @@
|
|||||||
// SPDX-License-Identifier: CC0-1.0
|
// SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
interface intf;
|
interface intf;
|
||||||
logic l;
|
logic l;
|
||||||
function void f1();
|
function void f1();
|
||||||
endfunction
|
endfunction
|
||||||
function void f2();
|
function void f2();
|
||||||
endfunction
|
endfunction
|
||||||
function void f3();
|
function void f3();
|
||||||
endfunction
|
endfunction
|
||||||
function void f4();
|
function void f4();
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
modport mpi (
|
modport mpi
|
||||||
import f1, f2,
|
(
|
||||||
input l,
|
import f1, f2,
|
||||||
import f3, f4
|
input l,
|
||||||
);
|
import f3, f4
|
||||||
modport mpo (
|
);
|
||||||
output l,
|
modport mpo
|
||||||
import f1, f2, f3, f4
|
(
|
||||||
);
|
output l,
|
||||||
|
import f1, f2, f3, f4
|
||||||
|
);
|
||||||
endinterface
|
endinterface
|
||||||
|
|
||||||
module mo (intf.mpo intf0);
|
module mo (intf.mpo intf0);
|
||||||
function void ef1();
|
function void ef1();
|
||||||
intf0.f1();
|
intf0.f1();
|
||||||
intf0.f2();
|
intf0.f2();
|
||||||
endfunction
|
endfunction
|
||||||
function void ef2();
|
function void ef2();
|
||||||
intf0.f3();
|
intf0.f3();
|
||||||
intf0.f4();
|
intf0.f4();
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
initial begin
|
initial begin
|
||||||
ef1();
|
ef1();
|
||||||
ef2();
|
ef2();
|
||||||
end
|
end
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
module mi (intf.mpi intf0);
|
module mi (intf.mpi intf0);
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
module t;
|
module t;
|
||||||
intf intf0();
|
intf intf0();
|
||||||
mi mi(.*);
|
mi mi(.*);
|
||||||
mo mo(.*);
|
mo mo(.*);
|
||||||
endmodule
|
endmodule
|
||||||
|
@ -68,8 +68,8 @@ module t (/*AUTOARG*/
|
|||||||
|
|
||||||
generate
|
generate
|
||||||
for (g=0; g<2; ++g) begin
|
for (g=0; g<2; ++g) begin
|
||||||
always_comb gen_arr_packed[g] = d;
|
always_comb gen_arr_packed[g] = d;
|
||||||
always_comb gen_arr_unpacked[g] = d;
|
always_comb gen_arr_unpacked[g] = d;
|
||||||
end
|
end
|
||||||
endgenerate
|
endgenerate
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
module t ();
|
module t ();
|
||||||
|
|
||||||
initial begin
|
initial begin
|
||||||
$dumpfile("dump.vcd");
|
$dumpfile("dump.vcd");
|
||||||
$dumpvars();
|
$dumpvars();
|
||||||
end
|
end
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
@ -6,13 +6,13 @@
|
|||||||
|
|
||||||
module t ();
|
module t ();
|
||||||
|
|
||||||
function automatic void func();
|
function automatic void func();
|
||||||
endfunction
|
endfunction
|
||||||
export "DPI-C" function func;
|
export "DPI-C" function func;
|
||||||
|
|
||||||
initial begin
|
initial begin
|
||||||
$dumpfile("dump.vcd");
|
$dumpfile("dump.vcd");
|
||||||
$dumpvars();
|
$dumpvars();
|
||||||
end
|
end
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
Loading…
Reference in New Issue
Block a user