Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #859: vpiModule & vpiInterface are part of standard #860

Merged
merged 1 commit into from
Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/sv_vpi_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C" {

/****************************** OBJECT TYPES ******************************/
#define vpiPackage 600
#define vpiInterfaceInst 601
#define vpiInterface 601
#define vpiProgram 602
#define vpiInterfaceArray 603
#define vpiProgramArray 604
Expand Down
2 changes: 1 addition & 1 deletion include/vpi_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ typedef PLI_UINT32 *vpiHandle;
#define vpiMemory 29 /* behavioral memory */
#define vpiMemoryWord 30 /* single word of memory */
#define vpiModPath 31 /* module path for path delays */
#define vpiModuleInst 32 /* module instance */
#define vpiModule 32 /* module instance */
#define vpiNamedBegin 33 /* named block statement */
#define vpiNamedEvent 34 /* event variable */
#define vpiNamedFork 35 /* named fork-join block */
Expand Down
6 changes: 3 additions & 3 deletions model/design.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
card: any
- class: allInterfaces
type: interface_inst
vpi_obj: vpiInterfaceInst
vpi_obj: vpiInterface
vpi: uhdmallInterfaces
card: any
- class: allUdps
Expand All @@ -66,7 +66,7 @@
card: any
- class: allModules
type: module_inst
vpi_obj: vpiModuleInst
vpi_obj: vpiModule
vpi: uhdmallModules
card: any
- class_ref: typespecs
Expand Down Expand Up @@ -95,6 +95,6 @@
card: any
- class: topModules
type: module_inst
vpi_obj: vpiModuleInst
vpi_obj: vpiModule
vpi: uhdmtopModules
card: any
4 changes: 2 additions & 2 deletions model/gen_scope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
card: any
- obj_ref: modules
name: modules
vpi: vpiModuleInst
vpi: vpiModule
type: module_inst
card: any
- obj_ref: module_arrays
Expand Down Expand Up @@ -102,7 +102,7 @@
card: any
- obj_ref: interfaces
name: interface_inst
vpi: vpiInterfaceInst
vpi: vpiInterface
type: interface_inst
card: any
- obj_ref: interface_arrays
Expand Down
2 changes: 1 addition & 1 deletion model/instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
card: any
- obj_ref: module_inst
name: module_inst
vpi: vpiModuleInst
vpi: vpiModule
type: module_inst
card: 1
- class_ref: instance
Expand Down
2 changes: 1 addition & 1 deletion model/instance_array.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
card: any
- obj_ref: modules
name: modules
vpi: vpiModuleInst
vpi: vpiModule
type: module_inst
card: any
- class_ref: elem_typespec
Expand Down
4 changes: 2 additions & 2 deletions model/interface_inst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
type: int
card: 1
- property: type
name: vpiInterfaceInst
name: vpiInterface
vpi: vpiType
type: unsigned int
card: 1
Expand Down Expand Up @@ -72,7 +72,7 @@
card: any
- obj_ref: interfaces
name: interface_inst
vpi: vpiInterfaceInst
vpi: vpiInterface
type: interface_inst
card: any
- obj_ref: interface_arrays
Expand Down
2 changes: 1 addition & 1 deletion model/modport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
card: any
- obj_ref: interface_inst
name: interface_inst
vpi: vpiInterfaceInst
vpi: vpiInterface
type: interface_inst
card: 1
6 changes: 3 additions & 3 deletions model/module_inst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
type: int
card: 1
- property: type
name: vpiModuleInst
name: vpiModule
vpi: vpiType
type: unsigned int
card: 1
Expand Down Expand Up @@ -68,7 +68,7 @@
card: any
- obj_ref: interfaces
name: interface_inst
vpi: vpiInterfaceInst
vpi: vpiInterface
type: interface_inst
card: any
- obj_ref: interface_arrays
Expand All @@ -83,7 +83,7 @@
card: any
- obj_ref: modules
name: modules
vpi: vpiModuleInst
vpi: vpiModule
type: module_inst
card: any
- obj_ref: module_arrays
Expand Down
2 changes: 1 addition & 1 deletion model/nets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,6 @@
card: 1
- obj_ref: module_inst
name: module_inst
vpi: vpiModuleInst
vpi: vpiModule
type: module_inst
card: 1
2 changes: 1 addition & 1 deletion model/ports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@
card: 1
- obj_ref: module_inst
name: module_inst
vpi: vpiModuleInst
vpi: vpiModule
type: module_inst
card: 1
2 changes: 1 addition & 1 deletion model/process_stmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
card: 1
- obj_ref: module_inst
name: module_inst
vpi: vpiModuleInst
vpi: vpiModule
type: module_inst
card: 1
- obj_ref: attributes
Expand Down
2 changes: 1 addition & 1 deletion model/program.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
card: 1
- obj_ref: interfaces
name: interface_inst
vpi: vpiInterfaceInst
vpi: vpiInterface
type: interface_inst
card: any
- group_ref: expr_dist
Expand Down
2 changes: 1 addition & 1 deletion model/tchk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- obj_ref: module_inst
name: module_inst
type: module_inst
vpi: vpiModuleInst
vpi: vpiModule
card: 1
- class_ref: expr
name: expr
Expand Down
4 changes: 2 additions & 2 deletions model/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
vpi: vpiTopModule
card: 1
- obj_ref: modules
vpi: vpiModuleInst
vpi: vpiModule
type: module_inst
card: any

- obj_def: design
- class: uhdmAllModules
type: module_inst
vpi_obj: vpiModuleInst
vpi_obj: vpiModule
card: any
2 changes: 1 addition & 1 deletion model/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
card: 1
- obj_ref: module_inst
name: module_inst
vpi: vpiModuleInst
vpi: vpiModule
type: module_inst
card: 1
- class_ref: instance
Expand Down
4 changes: 2 additions & 2 deletions scripts/VpiListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ def _get_listeners(classname, vpi, type, card):
listeners = []

if card == '1':
# upward vpiModuleInst, vpiInterfaceInst relation (when card == 1, pointing to the parent object) creates loops in visitors
if vpi in ['vpiParent', 'vpiInstance', 'vpiModuleInst', 'vpiInterfaceInst', 'vpiUse', 'vpiProgram', 'vpiClassDefn', 'vpiPackage', 'vpiUdp']:
# upward vpiModule, vpiInterface relation (when card == 1, pointing to the parent object) creates loops in visitors
if vpi in ['vpiParent', 'vpiInstance', 'vpiModule', 'vpiInterface', 'vpiUse', 'vpiProgram', 'vpiClassDefn', 'vpiPackage', 'vpiUdp']:
return listeners

if 'func_call' in classname and vpi == 'vpiFunction':
Expand Down
9 changes: 7 additions & 2 deletions scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ def get_modellist_filepath():


def make_vpi_name(classname):
classname_overrides = {
'module_inst': 'module',
'interface_inst': 'interface'
}
classname = classname_overrides.get(classname, classname)
vpiclasstype = f'vpi{classname[:1].upper()}{classname[1:]}'

underscore = False
Expand All @@ -125,7 +130,7 @@ def make_vpi_name(classname):
else:
vpiclasstype += ch

overrides = {
vpiname_overrides = {
'vpiForkStmt': 'vpiFork',
'vpiForStmt': 'vpiFor',
'vpiIoDecl': 'vpiIODecl',
Expand All @@ -149,4 +154,4 @@ def make_vpi_name(classname):
'vpiSwitchTran': 'vpiSwitch',
}

return overrides.get(vpiclasstype, vpiclasstype)
return vpiname_overrides.get(vpiclasstype, vpiclasstype)
2 changes: 1 addition & 1 deletion scripts/vpi_visitor_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def _get_implementation(classname, vpi, card):
if card == '1':
shallow_visit = 'false'

if vpi in ['vpiParent', 'vpiInstance', 'vpiModuleInst', 'vpiInterfaceInst', 'vpiUse', 'vpiProgram', 'vpiClassDefn', 'vpiPackage', 'vpiUdp']:
if vpi in ['vpiParent', 'vpiInstance', 'vpiModule', 'vpiInterface', 'vpiUse', 'vpiProgram', 'vpiClassDefn', 'vpiPackage', 'vpiUdp']:
# Prevent walking upwards and makes the UHDM output cleaner
# Prevent loop in Standard VPI
shallow_visit = 'true'
Expand Down
Loading