Skip to content

Commit a16d529

Browse files
committed
Merge branch 'master' into clock_modeling_2
Conflicts: vpr/src/place/timing_place_lookup.cpp
2 parents 754656c + ae4ce81 commit a16d529

File tree

78 files changed

+4917
-2814
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+4917
-2814
lines changed

ODIN_II/README.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,15 @@ Verilog Synthesizable Keyword Support:
243243
+-------------------+------------------+---------------------+--------------------+
244244
| assign | forever | ** | |
245245
+-------------------+------------------+---------------------+--------------------+
246-
| case | macromodule | ^~ | |
246+
| case | task | ^~ | |
247247
+-------------------+------------------+---------------------+--------------------+
248248
| defparam | repeat | <<< | |
249249
+-------------------+------------------+---------------------+--------------------+
250250
| end | signed | \>= | |
251251
+-------------------+------------------+---------------------+--------------------+
252252
| endfunction | specparam | || | |
253253
+-------------------+------------------+---------------------+--------------------+
254-
| endmodule | task | ~& | |
254+
| endmodule | | ~& | |
255255
+-------------------+------------------+---------------------+--------------------+
256256
| begin | | && | |
257257
+-------------------+------------------+---------------------+--------------------+
@@ -307,6 +307,8 @@ Verilog Synthesizable Keyword Support:
307307
+-------------------+------------------+---------------------+--------------------+
308308
| xor | | | |
309309
+-------------------+------------------+---------------------+--------------------+
310+
| macromodule | | | |
311+
+-------------------+------------------+---------------------+--------------------+
310312

311313

312314

ODIN_II/SRC/Hashtable.cpp

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
Permission is hereby granted, free of charge, to any person
3+
obtaining a copy of this software and associated documentation
4+
files (the "Software"), to deal in the Software without
5+
restriction, including without limitation the rights to use,
6+
copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the
8+
Software is furnished to do so, subject to the following
9+
conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21+
OTHER DEALINGS IN THE SOFTWARE.
22+
*/
23+
#include <string.h>
24+
#include <stdio.h>
25+
#include <stdlib.h>
26+
27+
#include "Hashtable.hpp"
28+
#include "odin_types.h"
29+
#include "vtr_memory.h"
30+
31+
void Hashtable::destroy_free_items()
32+
{
33+
for(auto kv: my_map)
34+
vtr::free(kv.second);
35+
}
36+
37+
void Hashtable::add(std::string key, void *item)
38+
{
39+
auto v = this->my_map.find(key);
40+
//what if key already exists ??
41+
if(v == this->my_map.end())
42+
{
43+
this->my_map.insert({key,item});
44+
}
45+
else
46+
{
47+
this->my_map.insert({key,item});
48+
}
49+
}
50+
51+
void* Hashtable::remove(std::string key)
52+
{
53+
void *value = NULL;
54+
auto v = this->my_map.find(key);
55+
if(v != this->my_map.end())
56+
{
57+
value = this->my_map[key];
58+
this->my_map.erase(key);
59+
}
60+
return value;
61+
}
62+
63+
void* Hashtable::get(std::string key)
64+
{
65+
void *value = NULL;
66+
auto v = this->my_map.find(key);
67+
if(v != this->my_map.end())
68+
value = this->my_map[key];
69+
70+
return value;
71+
}
72+
73+
bool Hashtable::is_empty ()
74+
{
75+
return (my_map.size() == 0);
76+
}

ODIN_II/SRC/ace.cpp

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ OTHER DEALINGS IN THE SOFTWARE.
2828
#include "bdd/cudd/cuddInt.h"
2929
#include "bdd/cudd/cudd.h"
3030

31+
#include "odin_error.h"
32+
#include "odin_util.h"
3133
#include "ace.h"
3234
#include "vtr_memory.h"
3335

@@ -45,13 +47,6 @@ OTHER DEALINGS IN THE SOFTWARE.
4547
#define BPI 32
4648
#define LOGBPI 5
4749

48-
#define fail(why) {\
49-
(void) fprintf(stderr, "Fatal error: file %s, line %d\n%s\n",\
50-
__FILE__, __LINE__, why);\
51-
(void) fflush(stdout);\
52-
abort();\
53-
}
54-
5550
#define LOOPINIT(size) ((size <= BPI) ? 1 : WHICH_WORD((size)-1))
5651

5752
#define WHICH_WORD(element) (((element) >> LOGBPI) + 1)
@@ -65,8 +60,8 @@ typedef unsigned int *pset;
6560

6661
#define ALLOC(type, num) ((type *) malloc(sizeof(type) * (num)))
6762

68-
#define set_remove(set, e) (set[WHICH_WORD(e)] &= ~ (1 << WHICH_BIT(e)))
69-
#define set_insert(set, e) (set[WHICH_WORD(e)] |= 1 << WHICH_BIT(e))
63+
#define set_remove(set, e) (set[WHICH_WORD(e)] &= ~ (shift_left_value_with_overflow_check(0x1, WHICH_BIT(e))))
64+
#define set_insert(set, e) (set[WHICH_WORD(e)] |= (shift_left_value_with_overflow_check(0x1, WHICH_BIT(e))))
7065
#define set_new(size) set_clear(ALLOC(unsigned int, set_size(size)), size)
7166
#define set_size(size) ((size) <= BPI ? 2 : (WHICH_WORD((size)-1) + 1))
7267

@@ -109,13 +104,13 @@ void alloc_and_init_ace_structs(netlist_t *net) {
109104
/*
110105
printf ( "alloc_and_init_activity_info\n");
111106
printf ( "----------------------------\n");
112-
printf ("PIs in network: %d\n", net->num_top_input_nodes);
113-
printf ("POs in network: %d\n", net->num_top_output_nodes);
107+
printf ("PIs in network: %ld\n", net->num_top_input_nodes);
108+
printf ("POs in network: %ld\n", net->num_top_output_nodes);
114109
115-
printf ("Nodes in network: %d\n", net->num_internal_nodes);
116-
printf ("FF Nodes in network: %d\n", net->num_ff_nodes);
117-
printf ("Forward Level Nodes in network: %d\n", net->num_forward_levels);
118-
printf ("Backward Level Nodes in network: %d\n", net->num_backward_levels);
110+
printf ("Nodes in network: %ld\n", net->num_internal_nodes);
111+
printf ("FF Nodes in network: %ld\n", net->num_ff_nodes);
112+
printf ("Forward Level Nodes in network: %ld\n", net->num_forward_levels);
113+
printf ("Backward Level Nodes in network: %ld\n", net->num_backward_levels);
119114
*/
120115

121116
// GND Node
@@ -398,7 +393,7 @@ void output_ace_info (netlist_t *net, FILE *act_out ) {
398393
void output_ace_info_node ( char *name, ace_obj_info_t *info, FILE *act_out ) {
399394

400395
/*
401-
printf ( "%s %f %f %f DEBUG: ONES: %3d TOGGLES: %d\n",
396+
printf ( "%s %f %f %f DEBUG: ONES: %3d TOGGLES: %ld\n",
402397
name,
403398
info->static_prob,
404399
info->switch_prob ,
@@ -440,22 +435,34 @@ pset set_clear(pset r, int size)
440435
int node_error(int code) {
441436
switch (code) {
442437
case 0:
443-
fail("node_get_cube: node does not have a function");
438+
error_message(ACE,-1, -1, "%s", "node_get_cube: node does not have a function");
444439
/* NOTREACHED */
440+
break;
441+
445442
case 1:
446-
fail("node_get_cube: cube index out of bounds");
443+
error_message(ACE,-1, -1, "%s","node_get_cube: cube index out of bounds");
447444
/* NOTREACHED */
445+
break;
446+
448447
case 2:
449-
fail("node_get_literal: bad cube");
448+
error_message(ACE,-1, -1, "%s","node_get_literal: bad cube");
450449
/* NOTREACHED */
450+
break;
451+
451452
case 4:
452-
fail("foreach_fanin: node changed during generation");
453+
error_message(ACE,-1, -1, "%s","foreach_fanin: node changed during generation");
453454
/* NOTREACHED */
455+
break;
456+
454457
case 5:
455-
fail("foreach_fanout: node changed during generation");
458+
error_message(ACE,-1, -1, "%s","foreach_fanout: node changed during generation");
456459
/* NOTREACHED */
460+
break;
461+
457462
default:
458-
fail("error code unused");
463+
error_message(ACE,-1, -1, "%s","error code unused");
464+
break;
465+
459466
}
460467
return 0;
461468
}
@@ -488,7 +495,7 @@ ace_cube_t * ace_cube_dup(ace_cube_t * cube) {
488495
set_insert(cube_copy->cube, 2 * i + 1);
489496
break;
490497
default:
491-
fail("Bad literal.");
498+
error_message(ACE,-1, -1, "%s","Bad literal.");
492499
}
493500
}
494501
return (cube_copy);
@@ -639,7 +646,7 @@ double calc_cube_switch_prob_recur(DdManager * mgr, DdNode * bdd, ace_cube_t * c
639646
+ (1.0 - fanin_info->static_prob) * else_prob;
640647
break;
641648
default:
642-
fail("Bad literal.");
649+
error_message(ACE,-1, -1, "%s","Bad literal.");
643650
}
644651
st__insert(visited, (char *) bdd, (char *) current_prob);
645652

0 commit comments

Comments
 (0)