Skip to content

Style: data_types#1

Merged
umarcor merged 9 commits intomasterfrom
style-arrays
May 26, 2019
Merged

Style: data_types#1
umarcor merged 9 commits intomasterfrom
style-arrays

Conversation

@umarcor
Copy link
Member

@umarcor umarcor commented Apr 23, 2019

This PR is based on VUnit#481 and it should be merged later.

This PR is work-in-progress towards VUnit#476 and VUnit#470.

  • The style of functions and procedures in almost all the sources in vunit/vhdl/data_types/src is modified:
function
func_name(
  paramA : typeofparamA
) return typeofreturn;
  • end function; and end procedure; are replaced with end; for coherency.

  • Aliases are added to integer_vector_ptr and string_ptr in order to highlight the similarities between these files. Compare, e.g., integer_vector_ptr_pkg-body-200x.vhd and string_ptr_pkg-body-200x.vhd before and after this PR:

Added(4,28)  Deleted(0,19) Changed(88) Changed in changed(71)
Added(40,16) Deleted(0,25) Changed(63) Changed in changed(43)
  • The definition of types integer_vector_t, integer_vector_access_t, string_ptr_access_t, etc. are moved to separate packages in a new subdir (vunit/vhdl/data_types/src/types). This is because, in the future, packages to support external models will depend on these types, and integer_vector_ptr_pkg/string_ptr_pkg will depend on the external models (or their placeholders).

  • In the VHDL 2008 sources, there is no need to use custom types for the pointers. 'natural' is used instead.

  • When external models are added, the variable inside the pointer types will not be an explicit index. I think that ref is a better name.

  • GHDL drops a lot of warnings because declaring parameter length hides the function name. Options are renamed to len to avoid it.

  • Parameter index used in get and set is declared as of type integer. However, it should be natural, because it is not possible to access to negative indexes.

@umarcor umarcor force-pushed the style-arrays branch 2 times, most recently from c096c8d to a3dff54 Compare April 25, 2019 11:42
@umarcor umarcor merged commit 0db2959 into master May 26, 2019
@umarcor umarcor deleted the style-arrays branch May 26, 2019 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments