vvp: Handles for dynamic array ranges.

This commit is contained in:
Maciej Suminski 2014-11-26 11:14:51 +01:00
parent b4ccaa1b0c
commit 21a8cb71ee
2 changed files with 17 additions and 3 deletions

View File

@ -57,12 +57,14 @@ unsigned __vpiDarrayVar::get_size() const
vpiHandle __vpiDarrayVar::get_left_range()
{
return NULL;
left_range_.set_value(0);
return &left_range_;
}
vpiHandle __vpiDarrayVar::get_right_range()
{
return NULL;
right_range_.set_value(get_size() - 1);
return &right_range_;
}
int __vpiDarrayVar::get_word_size() const
@ -141,7 +143,18 @@ char* __vpiDarrayVar::vpi_get_str(int code)
vpiHandle __vpiDarrayVar::vpi_handle(int code)
{
return 0;
switch (code) {
case vpiLeftRange:
return get_left_range();
case vpiRightRange:
return get_right_range();
//case vpiModule:
//return vpip_module(scope_);
}
return 0;
}
vpiHandle __vpiDarrayVar::vpi_index(int index)

View File

@ -589,6 +589,7 @@ class __vpiDarrayVar : public __vpiBaseVar, public __vpiArrayBase {
protected:
vvp_darray*get_vvp_darray() const;
__vpiDecConst left_range_, right_range_;
};
extern vpiHandle vpip_make_darray_var(const char*name, vvp_net_t*net);