HDLRuby 2.11.9 → 2.11.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25ee3661745db7f26a3656327f17f7f3cdb5482d234ffcd201133a6e6889ad00
4
- data.tar.gz: 40853bbc900fea15ac74a4bbe5a1cb6743404805d3cbdc159cbd0484136bd41b
3
+ metadata.gz: e198f5f11a15013478a077b8f2b7c2ee4caa8be3d73ded899e87ab9ea9a7b49b
4
+ data.tar.gz: baa9aa0fd414e9e476a62ee399eeb75c4f52ae77edb8ec6a70f473c9af60d681
5
5
  SHA512:
6
- metadata.gz: 4190fdac56a57319d1a0834efe74a7d84fc7674ff91492b0299a889a5b3a90bf684c05b4848d888a35bc51937218daa7aea1132140536aec5cca7972d9d2e918
7
- data.tar.gz: 17f63b1cb7793dd7cb0883db14a23730d3ba8d170f7b4092181e7cc0e2252349fa8dc17cabeb71e00dd778dc81048fb14934a8e437694dce5003d4088a5bd9b2
6
+ metadata.gz: 0b634c57a3a8337008355f9749c51089de6794cdf4040f1e75504ab6f6e0d82ad6f6f0100ea9092faf24b9dc09117d0b13061ab871cebb1e505c89be1aa060c0
7
+ data.tar.gz: c94fed24b1af8b586763e9ec042455eb96cf7a03982b066b7cba17928dd987d1e230cf46fd55e865357c42218dffa1dab9ad8048ef0a7d1277880764d7fbec5b
@@ -798,10 +798,10 @@ VALUE rcsim_add_systemT_inputs(VALUE mod, VALUE systemTV, VALUE sigVs) {
798
798
  long old_num = systemT->num_inputs;
799
799
  systemT->num_inputs += num;
800
800
  // printf("first systemT->inputs=%p\n",systemT->inputs); fflush(stdout);
801
- // systemT->inputs=realloc(systemT->inputs,
802
- // sizeof(SignalI[systemT->num_inputs]));
803
- systemT->inputs=(SignalI*)my_realloc(systemT->inputs,
804
- sizeof(SignalI[old_num]), sizeof(SignalI[systemT->num_inputs]));
801
+ systemT->inputs=realloc(systemT->inputs,
802
+ sizeof(SignalI[systemT->num_inputs]));
803
+ // systemT->inputs=(SignalI*)my_realloc(systemT->inputs,
804
+ // sizeof(SignalI[old_num]), sizeof(SignalI[systemT->num_inputs]));
805
805
  // printf("now systemT->inputs=%p\n",systemT->inputs); fflush(stdout);
806
806
  // printf("access test: %p\n",systemT->inputs[0]); fflush(stdout);
807
807
  /* Get and add the signals from the Ruby value. */
@@ -825,10 +825,10 @@ VALUE rcsim_add_systemT_outputs(VALUE mod, VALUE systemTV, VALUE sigVs) {
825
825
  long old_num = systemT->num_outputs;
826
826
  systemT->num_outputs += num;
827
827
  // printf("first systemT->outputs=%p\n",systemT->outputs); fflush(stdout);
828
- // systemT->outputs =realloc(systemT->outputs,
829
- // sizeof(SignalI[systemT->num_outputs]));
830
- systemT->outputs =(SignalI*)my_realloc(systemT->outputs,
831
- sizeof(SignalI[old_num]), sizeof(SignalI[systemT->num_outputs]));
828
+ systemT->outputs =realloc(systemT->outputs,
829
+ sizeof(SignalI[systemT->num_outputs]));
830
+ // systemT->outputs =(SignalI*)my_realloc(systemT->outputs,
831
+ // sizeof(SignalI[old_num]), sizeof(SignalI[systemT->num_outputs]));
832
832
  // printf("now systemT->outputs=%p\n",systemT->outputs); fflush(stdout);
833
833
  // printf("access test: %p\n",systemT->outputs[0]); fflush(stdout);
834
834
  /* Get and add the signals from the Ruby value. */
@@ -852,10 +852,10 @@ VALUE rcsim_add_systemT_inouts(VALUE mod, VALUE systemTV, VALUE sigVs) {
852
852
  long old_num = systemT->num_inouts;
853
853
  systemT->num_inouts += num;
854
854
  // printf("first systemT->inouts=%p\n",systemT->inouts); fflush(stdout);
855
- // systemT->inouts =realloc(systemT->inouts,
856
- // sizeof(SignalI[systemT->num_inouts]));
857
- systemT->inouts =(SignalI*)my_realloc(systemT->inouts,
858
- sizeof(SignalI[old_num]), sizeof(SignalI[systemT->num_inouts]));
855
+ systemT->inouts =realloc(systemT->inouts,
856
+ sizeof(SignalI[systemT->num_inouts]));
857
+ // systemT->inouts =(SignalI*)my_realloc(systemT->inouts,
858
+ // sizeof(SignalI[old_num]), sizeof(SignalI[systemT->num_inouts]));
859
859
  // printf("now systemT->inouts=%p\n",systemT->inouts); fflush(stdout);
860
860
  // printf("access test: %p\n",systemT->inouts[0]); fflush(stdout);
861
861
  /* Get and add the signals from the Ruby value. */
@@ -879,10 +879,10 @@ VALUE rcsim_add_scope_inners(VALUE mod, VALUE scopeV, VALUE sigVs) {
879
879
  long old_num = scope->num_inners;
880
880
  scope->num_inners += num;
881
881
  // printf("first scope->inners=%p\n",scope->inners); fflush(stdout);
882
- // scope->inners = realloc(scope->inners,
883
- // sizeof(SignalI[scope->num_inners]));
884
- scope->inners = (SignalI*)my_realloc(scope->inners,
885
- sizeof(SignalI[old_num]), sizeof(SignalI[scope->num_inners]));
882
+ scope->inners = realloc(scope->inners,
883
+ sizeof(SignalI[scope->num_inners]));
884
+ // scope->inners = (SignalI*)my_realloc(scope->inners,
885
+ // sizeof(SignalI[old_num]), sizeof(SignalI[scope->num_inners]));
886
886
  // printf("now scope->inners=%p\n",scope->inners); fflush(stdout);
887
887
  // printf("access test: %p\n",scope->inners[0]); fflush(stdout);
888
888
  /* Get and add the signals from the Ruby value. */
@@ -909,10 +909,10 @@ VALUE rcsim_add_scope_behaviors(VALUE mod, VALUE scopeV, VALUE behVs) {
909
909
  // printf("scope->behaviors=%p\n",scope->behaviors);
910
910
  scope->num_behaviors += num;
911
911
  // printf("first scope->behaviors=%p\n",scope->behaviors); fflush(stdout);
912
- // scope->behaviors = realloc(scope->behaviors,
913
- // sizeof(Behavior[scope->num_behaviors]));
914
- scope->behaviors = (Behavior*)my_realloc(scope->behaviors,
915
- sizeof(Behavior[old_num]), sizeof(Behavior[scope->num_behaviors]));
912
+ scope->behaviors = realloc(scope->behaviors,
913
+ sizeof(Behavior[scope->num_behaviors]));
914
+ // scope->behaviors = (Behavior*)my_realloc(scope->behaviors,
915
+ // sizeof(Behavior[old_num]), sizeof(Behavior[scope->num_behaviors]));
916
916
  // printf("now scope->behaviors=%p\n",scope->behaviors); fflush(stdout);
917
917
  // printf("access test: %p\n",scope->behaviors[0]); fflush(stdout);
918
918
  /* Get and add the behaviors from the Ruby value. */
@@ -936,10 +936,10 @@ VALUE rcsim_add_scope_systemIs(VALUE mod, VALUE scopeV, VALUE sysVs) {
936
936
  long old_num = scope->num_systemIs;
937
937
  scope->num_systemIs += num;
938
938
  // printf("first scope->systemIs=%p\n",scope->systemIs); fflush(stdout);
939
- // scope->systemIs = realloc(scope->systemIs,
940
- // sizeof(SystemI[scope->num_systemIs]));
941
- scope->systemIs = (SystemI*)my_realloc(scope->systemIs,
942
- sizeof(SystemI[old_num]), sizeof(SystemI[scope->num_systemIs]));
939
+ scope->systemIs = realloc(scope->systemIs,
940
+ sizeof(SystemI[scope->num_systemIs]));
941
+ // scope->systemIs = (SystemI*)my_realloc(scope->systemIs,
942
+ // sizeof(SystemI[old_num]), sizeof(SystemI[scope->num_systemIs]));
943
943
  // printf("now scope->systemIs=%p\n",scope->systemIs); fflush(stdout);
944
944
  // printf("access test: %p\n",scope->systemIs[0]); fflush(stdout);
945
945
  /* Get and add the system instances from the Ruby value. */
@@ -963,10 +963,10 @@ VALUE rcsim_add_scope_scopes(VALUE mod, VALUE scopeV, VALUE scpVs) {
963
963
  long old_num = scope->num_scopes;
964
964
  scope->num_scopes += num;
965
965
  // printf("first scope->scopes=%p\n",scope->scopes); fflush(stdout);
966
- // scope->scopes = realloc(scope->scopes,
967
- // sizeof(Scope[scope->num_scopes]));
968
- scope->scopes = (Scope*)my_realloc(scope->scopes,
969
- sizeof(Scope[old_num]), sizeof(Scope[scope->num_scopes]));
966
+ scope->scopes = realloc(scope->scopes,
967
+ sizeof(Scope[scope->num_scopes]));
968
+ // scope->scopes = (Scope*)my_realloc(scope->scopes,
969
+ // sizeof(Scope[old_num]), sizeof(Scope[scope->num_scopes]));
970
970
  // printf("now scope->scopes=%p\n",scope->scopes); fflush(stdout);
971
971
  // printf("access test: %p\n",scope->scopes[0]); fflush(stdout);
972
972
  /* Get and add the sub scopes from the Ruby value. */
@@ -990,10 +990,10 @@ VALUE rcsim_add_behavior_events(VALUE mod, VALUE behaviorV, VALUE eventVs) {
990
990
  long old_num = behavior->num_events;
991
991
  behavior->num_events += num;
992
992
  // printf("first behavior->events=%p\n",behavior->events); fflush(stdout);
993
- // behavior->events = realloc(behavior->events,
994
- // sizeof(Event[behavior->num_events]));
995
- behavior->events = (Event*)my_realloc(behavior->events,
996
- sizeof(Event[old_num]), sizeof(Event[behavior->num_events]));
993
+ behavior->events = realloc(behavior->events,
994
+ sizeof(Event[behavior->num_events]));
995
+ // behavior->events = (Event*)my_realloc(behavior->events,
996
+ // sizeof(Event[old_num]), sizeof(Event[behavior->num_events]));
997
997
  // printf("now behavior->events=%p\n",behavior->events); fflush(stdout);
998
998
  // printf("access test: %p\n",behavior->events[0]); fflush(stdout);
999
999
  /* Get and add the events from the Ruby value. */
@@ -1008,9 +1008,9 @@ VALUE rcsim_add_behavior_events(VALUE mod, VALUE behaviorV, VALUE eventVs) {
1008
1008
  case ANYEDGE:
1009
1009
  sig->num_any++;
1010
1010
  // printf("first sig->any=%p\n",sig->any); fflush(stdout);
1011
- // sig->any = realloc(sig->any,sizeof(Object[sig->num_any]));
1012
- sig->any = (Object*)my_realloc(sig->any,
1013
- sizeof(Object[sig->num_any-1]),sizeof(Object[sig->num_any]));
1011
+ sig->any = realloc(sig->any,sizeof(Object[sig->num_any]));
1012
+ // sig->any = (Object*)my_realloc(sig->any,
1013
+ // sizeof(Object[sig->num_any-1]),sizeof(Object[sig->num_any]));
1014
1014
  // printf("now sig->any=%p\n",sig->any); fflush(stdout);
1015
1015
  // printf("access test: %p\n",sig->any[0]); fflush(stdout);
1016
1016
  // show_access(sig->any,sig->num_any-1);
@@ -1020,9 +1020,9 @@ VALUE rcsim_add_behavior_events(VALUE mod, VALUE behaviorV, VALUE eventVs) {
1020
1020
  case POSEDGE:
1021
1021
  sig->num_pos++;
1022
1022
  // printf("first sig->pos=%p\n",sig->pos); fflush(stdout);
1023
- // sig->pos = realloc(sig->pos,sizeof(Object[sig->num_pos]));
1024
- sig->pos = (Object*)my_realloc(sig->pos,
1025
- sizeof(Object[sig->num_pos-1]),sizeof(Object[sig->num_pos]));
1023
+ sig->pos = realloc(sig->pos,sizeof(Object[sig->num_pos]));
1024
+ // sig->pos = (Object*)my_realloc(sig->pos,
1025
+ // sizeof(Object[sig->num_pos-1]),sizeof(Object[sig->num_pos]));
1026
1026
  // printf("now sig->pos=%p\n",sig->pos); fflush(stdout);
1027
1027
  // printf("access test: %p\n",sig->pos[0]); fflush(stdout);
1028
1028
  // show_access(sig->pos,sig->num_pos-1);
@@ -1032,9 +1032,9 @@ VALUE rcsim_add_behavior_events(VALUE mod, VALUE behaviorV, VALUE eventVs) {
1032
1032
  case NEGEDGE:
1033
1033
  sig->num_neg++;
1034
1034
  // printf("first sig->neg=%p\n",sig->neg); fflush(stdout);
1035
- // sig->neg = realloc(sig->neg,sizeof(Object[sig->num_neg]));
1036
- sig->neg = (Object*)my_realloc(sig->neg,
1037
- sizeof(Object[sig->num_neg-1]),sizeof(Object[sig->num_neg]));
1035
+ sig->neg = realloc(sig->neg,sizeof(Object[sig->num_neg]));
1036
+ // sig->neg = (Object*)my_realloc(sig->neg,
1037
+ // sizeof(Object[sig->num_neg-1]),sizeof(Object[sig->num_neg]));
1038
1038
  // printf("now sig->neg=%p\n",sig->neg); fflush(stdout);
1039
1039
  // printf("access test: %p\n",sig->neg[0]); fflush(stdout);
1040
1040
  // show_access(sig->neg,sig->num_neg-1);
@@ -1059,10 +1059,10 @@ VALUE rcsim_add_systemI_systemTs(VALUE mod, VALUE systemIV, VALUE sysVs) {
1059
1059
  long old_num = systemI->num_systems;
1060
1060
  systemI->num_systems += num;
1061
1061
  // printf("first systemI->systems=%p\n",systemI->systems); fflush(stdout);
1062
- // systemI->systems=realloc(systemI->systems,
1063
- // sizeof(SystemT[systemI->num_systems]));
1064
- systemI->systems = (SystemT*)my_realloc(systemI->systems,
1065
- sizeof(SystemT[old_num]), sizeof(SystemT[systemI->num_systems]));
1062
+ systemI->systems=realloc(systemI->systems,
1063
+ sizeof(SystemT[systemI->num_systems]));
1064
+ // systemI->systems = (SystemT*)my_realloc(systemI->systems,
1065
+ // sizeof(SystemT[old_num]), sizeof(SystemT[systemI->num_systems]));
1066
1066
  // printf("now systemI->systems=%p\n",systemI->systems); fflush(stdout);
1067
1067
  // printf("access test: %p\n",systemI->systems[0]); fflush(stdout);
1068
1068
  /* Get and add the alternate system types from the Ruby value. */
@@ -1086,10 +1086,10 @@ VALUE rcsim_add_print_args(VALUE mod, VALUE printV, VALUE argVs) {
1086
1086
  long old_num = print->num_args;
1087
1087
  print->num_args += num;
1088
1088
  // printf("first print->args=%p\n",print->args); fflush(stdout);
1089
- // print->args = realloc(print->args,
1090
- // sizeof(Expression[print->num_args]));
1091
- print->args = (Expression*)my_realloc(print->args,
1092
- sizeof(Expression[old_num]), sizeof(Expression[print->num_args]));
1089
+ print->args = realloc(print->args,
1090
+ sizeof(Expression[print->num_args]));
1091
+ // print->args = (Expression*)my_realloc(print->args,
1092
+ // sizeof(Expression[old_num]), sizeof(Expression[print->num_args]));
1093
1093
  // printf("now print->args=%p\n",print->args); fflush(stdout);
1094
1094
  // printf("access test: %p\n",print->args[0]); fflush(stdout);
1095
1095
  /* Get and add the arguments from the Ruby value. */
@@ -1114,14 +1114,14 @@ VALUE rcsim_add_hif_noifs(VALUE mod, VALUE hifV, VALUE condVs, VALUE stmntVs) {
1114
1114
  hif->num_noifs += num;
1115
1115
  // printf("first hif->noconds=%p\n",hif->noconds); fflush(stdout);
1116
1116
  // printf("first hif->nostmnts=%p\n",hif->nostmnts); fflush(stdout);
1117
- // hif->noconds = realloc(hif->noconds,sizeof(Expression[hif->num_noifs]));
1118
- hif->noconds = (Expression*)my_realloc(hif->noconds,
1119
- sizeof(Expression[old_num]),sizeof(Expression[hif->num_noifs]));
1117
+ hif->noconds = realloc(hif->noconds,sizeof(Expression[hif->num_noifs]));
1118
+ // hif->noconds = (Expression*)my_realloc(hif->noconds,
1119
+ // sizeof(Expression[old_num]),sizeof(Expression[hif->num_noifs]));
1120
1120
  // printf("now hif->noconds=%p\n",hif->noconds); fflush(stdout);
1121
1121
  // printf("access test: %p\n",hif->noconds[0]); fflush(stdout);
1122
- // hif->nostmnts = realloc(hif->nostmnts,sizeof(Statement[hif->num_noifs]));
1123
- hif->nostmnts = (Statement*)my_realloc(hif->nostmnts,
1124
- sizeof(Statement[old_num]),sizeof(Statement[hif->num_noifs]));
1122
+ hif->nostmnts = realloc(hif->nostmnts,sizeof(Statement[hif->num_noifs]));
1123
+ // hif->nostmnts = (Statement*)my_realloc(hif->nostmnts,
1124
+ // sizeof(Statement[old_num]),sizeof(Statement[hif->num_noifs]));
1125
1125
  // printf("now hif->nostmnts=%p\n",hif->nostmnts); fflush(stdout);
1126
1126
  // printf("access test: %p\n",hif->nostmnts[0]); fflush(stdout);
1127
1127
  /* Get and add the noifs from the Ruby value. */
@@ -1150,16 +1150,16 @@ VALUE rcsim_add_hcase_whens(VALUE mod, VALUE hcaseV, VALUE matchVs, VALUE stmntV
1150
1150
  hcase->num_whens += num;
1151
1151
  // printf("first hcase->matches=%p\n",hcase->matches); fflush(stdout);
1152
1152
  // printf("first hcase->stmnts=%p\n",hcase->stmnts); fflush(stdout);
1153
- // hcase->matches = realloc(hcase->matches,
1154
- // sizeof(Expression[hcase->num_whens]));
1155
- hcase->matches = (Expression*)my_realloc(hcase->matches,
1156
- sizeof(Expression[old_num]), sizeof(Expression[hcase->num_whens]));
1153
+ hcase->matches = realloc(hcase->matches,
1154
+ sizeof(Expression[hcase->num_whens]));
1155
+ // hcase->matches = (Expression*)my_realloc(hcase->matches,
1156
+ // sizeof(Expression[old_num]), sizeof(Expression[hcase->num_whens]));
1157
1157
  // printf("now hcase->matches=%p\n",hcase->matches); fflush(stdout);
1158
1158
  // printf("access test: %p\n",hcase->matches[0]); fflush(stdout);
1159
- // hcase->stmnts = realloc(hcase->stmnts,
1160
- // sizeof(Statement[hcase->num_whens]));
1161
- hcase->stmnts = (Statement*)my_realloc(hcase->stmnts,
1162
- sizeof(Statement[old_num]), sizeof(Statement[hcase->num_whens]));
1159
+ hcase->stmnts = realloc(hcase->stmnts,
1160
+ sizeof(Statement[hcase->num_whens]));
1161
+ // hcase->stmnts = (Statement*)my_realloc(hcase->stmnts,
1162
+ // sizeof(Statement[old_num]), sizeof(Statement[hcase->num_whens]));
1163
1163
  // printf("now hcase->stmnts=%p\n",hcase->stmnts); fflush(stdout);
1164
1164
  // printf("access test: %p\n",hcase->stmnts[0]); fflush(stdout);
1165
1165
  /* Get and add the whens from the Ruby value. */
@@ -1187,10 +1187,10 @@ VALUE rcsim_add_block_inners(VALUE mod, VALUE blockV, VALUE sigVs) {
1187
1187
  long old_num = block->num_inners;
1188
1188
  block->num_inners += num;
1189
1189
  // printf("first block->inners=%p\n",block->inners); fflush(stdout);
1190
- // block->inners = realloc(block->inners,
1191
- // sizeof(SignalI[block->num_inners]));
1192
- block->inners = (SignalI*)my_realloc(block->inners,
1193
- sizeof(SignalI[old_num]), sizeof(SignalI[block->num_inners]));
1190
+ block->inners = realloc(block->inners,
1191
+ sizeof(SignalI[block->num_inners]));
1192
+ // block->inners = (SignalI*)my_realloc(block->inners,
1193
+ // sizeof(SignalI[old_num]), sizeof(SignalI[block->num_inners]));
1194
1194
  // printf("now block->inners=%p\n",block->inners); fflush(stdout);
1195
1195
  // printf("access test: %p\n",block->inners[0]); fflush(stdout);
1196
1196
  /* Get and add the signals from the Ruby value. */
@@ -1214,10 +1214,10 @@ VALUE rcsim_add_block_statements(VALUE mod, VALUE blockV, VALUE stmntVs) {
1214
1214
  long old_num = block->num_stmnts;
1215
1215
  block->num_stmnts += num;
1216
1216
  // printf("first block->stmnts=%p\n",block->stmnts); fflush(stdout);
1217
- // block->stmnts = realloc(block->stmnts,
1218
- // sizeof(Statement[block->num_stmnts]));
1219
- block->stmnts = (Statement*)my_realloc(block->stmnts,
1220
- sizeof(Statement[old_num]), sizeof(Statement[block->num_stmnts]));
1217
+ block->stmnts = realloc(block->stmnts,
1218
+ sizeof(Statement[block->num_stmnts]));
1219
+ // block->stmnts = (Statement*)my_realloc(block->stmnts,
1220
+ // sizeof(Statement[old_num]), sizeof(Statement[block->num_stmnts]));
1221
1221
  // printf("now block->stmnts=%p\n",block->stmnts); fflush(stdout);
1222
1222
  // printf("access test: %p\n",block->stmnts[0]); fflush(stdout);
1223
1223
  /* Get and add the statements from the Ruby value. */
@@ -1241,10 +1241,10 @@ VALUE rcsim_add_select_choices(VALUE mod, VALUE selectV, VALUE choiceVs) {
1241
1241
  long old_num = select->num_choices;
1242
1242
  select->num_choices += num;
1243
1243
  // printf("first select->choices=%p\n",select->choices); fflush(stdout);
1244
- // select->choices = realloc(select->choices,
1245
- // sizeof(Expression[select->num_choices]));
1246
- select->choices = (Expression*)my_realloc(select->choices,
1247
- sizeof(Expression[old_num]),sizeof(Expression[select->num_choices]));
1244
+ select->choices = realloc(select->choices,
1245
+ sizeof(Expression[select->num_choices]));
1246
+ // Select->choices = (Expression*)my_realloc(select->choices,
1247
+ // sizeof(Expression[old_num]),sizeof(Expression[select->num_choices]));
1248
1248
  // printf("now select->choices=%p\n",select->choices); fflush(stdout);
1249
1249
  // printf("access test: %p\n",select->choices[0]); fflush(stdout);
1250
1250
  /* Get and add the choices from the Ruby value. */
@@ -1269,10 +1269,10 @@ VALUE rcsim_add_concat_expressions(VALUE mod, VALUE concatV, VALUE exprVs) {
1269
1269
  // printf("add_concat_expressions with num=%li old_num=%li\n",num,old_num);
1270
1270
  concat->num_exprs += num;
1271
1271
  // printf("first concat->exprs=%p\n",concat->exprs); fflush(stdout);
1272
- // concat->exprs = realloc(concat->exprs,
1273
- // sizeof(Expression[concat->num_exprs]));
1274
- concat->exprs = (Expression*)my_realloc(concat->exprs,
1275
- sizeof(Expression[old_num]), sizeof(Expression[concat->num_exprs]));
1272
+ concat->exprs = realloc(concat->exprs,
1273
+ sizeof(Expression[concat->num_exprs]));
1274
+ // concat->exprs = (Expression*)my_realloc(concat->exprs,
1275
+ // sizeof(Expression[old_num]), sizeof(Expression[concat->num_exprs]));
1276
1276
  // printf("now concat->exprs=%p\n",concat->exprs); fflush(stdout);
1277
1277
  // printf("access test: %p\n",concat->exprs[0]); fflush(stdout);
1278
1278
  /* Get and add the expressions from the Ruby value. */
@@ -1296,10 +1296,10 @@ VALUE rcsim_add_refConcat_refs(VALUE mod, VALUE refConcatV, VALUE refVs) {
1296
1296
  long old_num = refConcat->num_refs;
1297
1297
  refConcat->num_refs += num;
1298
1298
  // printf("first refConcat->refs=%p\n",refConcat->refs); fflush(stdout);
1299
- // refConcat->refs = realloc(refConcat->refs,
1300
- // sizeof(Reference[refConcat->num_refs]));
1301
- refConcat->refs = (Reference*)my_realloc(refConcat->refs,
1302
- sizeof(Reference[old_num]), sizeof(Reference[refConcat->num_refs]));
1299
+ refConcat->refs = realloc(refConcat->refs,
1300
+ sizeof(Reference[refConcat->num_refs]));
1301
+ // refConcat->refs = (Reference*)my_realloc(refConcat->refs,
1302
+ // sizeof(Reference[old_num]), sizeof(Reference[refConcat->num_refs]));
1303
1303
  // printf("now refConcat->refs=%p\n",refConcat->refs); fflush(stdout);
1304
1304
  // printf("access test: %p\n",refConcat->refs[0]); fflush(stdout);
1305
1305
  /* Get and add the references from the Ruby value. */
@@ -83,7 +83,7 @@ static void add_hash_type(Type type) {
83
83
  List entry = hash_type[hvalue];
84
84
  if (!entry) {
85
85
  /* No entry, create a new one. */
86
- entry = malloc(sizeof(List));
86
+ entry = (List)malloc(sizeof(ListS));
87
87
  entry = build_list(entry);
88
88
  }
89
89
  /* Adds the type to the entry. */
@@ -201,16 +201,24 @@ Value make_value(Type type, int numeric) {
201
201
  /* Compute the size in words of the data contained in the value. */
202
202
  unsigned long long width = type_width(type);
203
203
  /* Allocate the value. */
204
- Value res = calloc(1,sizeof(ValueS));
204
+ // Value res = calloc(1,sizeof(ValueS));
205
+ Value res = malloc(sizeof(ValueS));
206
+ #ifdef RCSIM
207
+ res->kind = VALUEE;
208
+ res->owner = 0;
209
+ #endif
205
210
  /* Allocates the data of the value. */
206
211
  if (!numeric) {
207
212
  /* Allocate the bit string and fill it with u (undefined) by default. */
208
- res->data_str = malloc(sizeof(char)*width);
213
+ // res->data_str = malloc(sizeof(char)*width);
214
+ res->data_str = malloc(sizeof(char)*width+1);
209
215
  memset(res->data_str,'x',width);
216
+ res->data_str[width] = 0;
210
217
  /* And set its capacity to the type width. */
211
- res->capacity = width;
218
+ res->capacity = width+1;
212
219
  } else {
213
220
  res->capacity = 0;
221
+ res->data_str = 0;
214
222
  }
215
223
 
216
224
  /* Initialize it. */
@@ -229,8 +237,8 @@ void resize_value(Value value, unsigned long long size) {
229
237
  if (value->capacity < size) {
230
238
  /* Resizing required, to limit frequent resize, double the
231
239
  * required new capacity. */
232
- /* Free the former data. */
233
- free(value->data_str);
240
+ /* Free the former data if required. */
241
+ if (value->capacity > 0) free(value->data_str);
234
242
  /* Reallocate it. */
235
243
  value->data_str = calloc(size*2,sizeof(char));
236
244
  /* Update the size. */
@@ -1874,7 +1882,7 @@ static Value sub_value_numeric(Value src0, Value src1, Value dst) {
1874
1882
  * @param dst the destination value
1875
1883
  * @return dst */
1876
1884
  static Value mul_value_numeric(Value src0, Value src1, Value dst) {
1877
- printf("mul_value_numeric with src0->data_int=%llx src1->data_int=%llx\n",src0->data_int, src1->data_int);
1885
+ // printf("mul_value_numeric with src0->data_int=%llx src1->data_int=%llx\n",src0->data_int, src1->data_int);
1878
1886
  /* Sets state of the destination using the first source. */
1879
1887
  dst->type = src0->type;
1880
1888
  dst->numeric = 1;
@@ -86,8 +86,8 @@ void register_timed_behavior(Behavior behavior) {
86
86
  } else {
87
87
  /* Need to increase the capacity. */
88
88
  Behavior* behaviors = calloc(cap_timed_behaviors*2,sizeof(Behavior));
89
- // memcpy(behaviors,timed_behaviors,sizeof(Behavior)*cap_timed_behaviors);
90
89
  memcpy(behaviors,timed_behaviors,sizeof(Behavior[cap_timed_behaviors]));
90
+ free(timed_behaviors);
91
91
  timed_behaviors = behaviors;
92
92
  cap_timed_behaviors *= 2;
93
93
  }
@@ -110,6 +110,7 @@ void register_init_behavior(Behavior beh) {
110
110
  Behavior* new_behs = calloc(cap_init_behaviors*2,sizeof(Behavior));
111
111
  memcpy(new_behs,init_behaviors,sizeof(Behavior[cap_init_behaviors]));
112
112
  cap_init_behaviors *= 2;
113
+ free(init_behaviors);
113
114
  init_behaviors=new_behs;
114
115
  }
115
116
  }
@@ -129,9 +130,9 @@ void register_signal(SignalI signal) {
129
130
  } else {
130
131
  /* Need to increase the capacity. */
131
132
  SignalI* new_signals = calloc(cap_all_signals*2,sizeof(SignalI));
132
- // memcpy(new_signals,all_signals,sizeof(SignalI)*cap_all_signals);
133
133
  memcpy(new_signals,all_signals,sizeof(SignalI[cap_all_signals]));
134
134
  cap_all_signals *= 2;
135
+ free(all_signals);
135
136
  all_signals=new_signals;
136
137
  }
137
138
  }
@@ -19,7 +19,7 @@ Elem get_element(void* data) {
19
19
  /* Is the pool empty? */
20
20
  if (empty_list(&pool_elements)) {
21
21
  /* Yes, allocates a new element. */
22
- elem = malloc(sizeof(ElemS));
22
+ elem = (Elem)malloc(sizeof(ElemS));
23
23
  elem->data = data;
24
24
  elem->next = NULL;
25
25
  } else {
@@ -86,7 +86,8 @@ Value unary(Value (*oper)(Value,Value)) {
86
86
  // dst = oper(pop(),dst);
87
87
  // push(dst);
88
88
  // return dst;
89
- return oper(pop(),peek());
89
+ Value v = pop();
90
+ return oper(v,peek());
90
91
  }
91
92
 
92
93
  /** Binary calculation.
@@ -198,22 +198,27 @@ module HDLRuby::High
198
198
  end)
199
199
  end
200
200
 
201
- # Create and add the behaviors.
202
- if self.each_behavior.any? then
203
- RCSim.rcsim_add_scope_behaviors(@rcscope,
204
- self.each_behavior.map do |beh|
205
- # beh.to_rcsim(@rcscope)
206
- beh.to_rcsim(subowner)
207
- end)
208
- end
201
+ # # Create and add the behaviors.
202
+ # if self.each_behavior.any? then
203
+ # RCSim.rcsim_add_scope_behaviors(@rcscope,
204
+ # self.each_behavior.map do |beh|
205
+ # # beh.to_rcsim(@rcscope)
206
+ # beh.to_rcsim(subowner)
207
+ # end)
208
+ # end
209
209
 
210
- # Create and add the connections.
211
- if self.each_connection.any? then
212
- RCSim.rcsim_add_scope_behaviors(@rcscope,
213
- self.each_connection.map do |cxt|
214
- # cxt.to_rcsim(@rcscope)
215
- cxt.to_rcsim(subowner)
216
- end)
210
+ # # Create and add the connections.
211
+ # if self.each_connection.any? then
212
+ # RCSim.rcsim_add_scope_behaviors(@rcscope,
213
+ # self.each_connection.map do |cxt|
214
+ # # cxt.to_rcsim(@rcscope)
215
+ # cxt.to_rcsim(subowner)
216
+ # end)
217
+ # end
218
+ rcbehs = self.each_behavior.map {|beh| beh.to_rcsim(subowner)} +
219
+ self.each_connection.map {|cxt| cxt.to_rcsim(subowner) }
220
+ if rcbehs.any? then
221
+ RCSim.rcsim_add_scope_behaviors(@rcscope,rcbehs)
217
222
  end
218
223
 
219
224
  # Create and add the codes.
@@ -755,9 +760,7 @@ module HDLRuby::High
755
760
 
756
761
  # Create and set the block.
757
762
  rcblock = RCSim.rcsim_make_block(:par)
758
- # RCSim.rcsim_add_block_statement(
759
- # RCSim.rcsim_make_transmit(self.left.to_rcsim,
760
- # self.right.to_rcsim))
763
+ RCSim.rcsim_set_owner(rcblock,@rcbehavior)
761
764
  # puts "self.left=#{self.left} self.right=#{self.right}"
762
765
  RCSim.rcsim_add_block_statements(rcblock,
763
766
  [RCSim.rcsim_make_transmit(self.left.to_rcsim, self.right.to_rcsim)])
@@ -1,3 +1,3 @@
1
1
  module HDLRuby
2
- VERSION = "2.11.9"
2
+ VERSION = "2.11.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HDLRuby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.9
4
+ version: 2.11.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lovic Gauthier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-11 00:00:00.000000000 Z
11
+ date: 2022-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler