Support second argument of sdf_annotate
The second argument of $sdf_annotate is the scope that is to be annotated. The argument is optional, and the default is to annotate the current scope, where the $sdf_annotate is invoked. Signed-off-by: Stephen Williams <steve@icarus.com>
This commit is contained in:
parent
25a24e748f
commit
f602687187
|
|
@ -204,6 +204,21 @@ static void check_command_line_args(void)
|
||||||
static PLI_INT32 sys_sdf_annotate_compiletf(PLI_BYTE8*name)
|
static PLI_INT32 sys_sdf_annotate_compiletf(PLI_BYTE8*name)
|
||||||
{
|
{
|
||||||
check_command_line_args();
|
check_command_line_args();
|
||||||
|
|
||||||
|
vpiHandle sys = vpi_handle(vpiSysTfCall,0);
|
||||||
|
vpiHandle argv = vpi_iterate(vpiArgument, sys);
|
||||||
|
|
||||||
|
vpiHandle path = vpi_scan(argv);
|
||||||
|
assert(path);
|
||||||
|
|
||||||
|
vpiHandle scope = vpi_scan(argv);
|
||||||
|
if (scope == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
assert(vpi_get(vpiType,scope) == vpiModule);
|
||||||
|
|
||||||
|
vpi_free_object(argv);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -213,11 +228,10 @@ static PLI_INT32 sys_sdf_annotate_calltf(PLI_BYTE8*name)
|
||||||
vpiHandle sys = vpi_handle(vpiSysTfCall,0);
|
vpiHandle sys = vpi_handle(vpiSysTfCall,0);
|
||||||
vpiHandle argv = vpi_iterate(vpiArgument, sys);
|
vpiHandle argv = vpi_iterate(vpiArgument, sys);
|
||||||
|
|
||||||
|
/* The first argument is the path to the SDF file. */
|
||||||
vpiHandle path = vpi_scan(argv);
|
vpiHandle path = vpi_scan(argv);
|
||||||
assert(path);
|
assert(path);
|
||||||
|
|
||||||
vpi_free_object(argv);
|
|
||||||
|
|
||||||
value.format = vpiStringVal;
|
value.format = vpiStringVal;
|
||||||
vpi_get_value(path, &value);
|
vpi_get_value(path, &value);
|
||||||
|
|
||||||
|
|
@ -232,7 +246,14 @@ static PLI_INT32 sys_sdf_annotate_calltf(PLI_BYTE8*name)
|
||||||
FILE*sdf_fd = fopen(path_str, "r");
|
FILE*sdf_fd = fopen(path_str, "r");
|
||||||
assert(sdf_fd);
|
assert(sdf_fd);
|
||||||
|
|
||||||
sdf_scope = vpi_handle(vpiScope,sys);
|
/* The optional second argument is the scope to annotate. */
|
||||||
|
sdf_scope = vpi_scan(argv);
|
||||||
|
if (sdf_scope)
|
||||||
|
vpi_free_object(argv);
|
||||||
|
if (sdf_scope == 0) {
|
||||||
|
sdf_scope = vpi_handle(vpiScope,sys);
|
||||||
|
}
|
||||||
|
|
||||||
sdf_cur_cell = 0;
|
sdf_cur_cell = 0;
|
||||||
|
|
||||||
sdf_process_file(sdf_fd, path_str);
|
sdf_process_file(sdf_fd, path_str);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue