|
15 | 15 | *
|
16 | 16 | * SPDX-License-Identifier: Apache-2.0
|
17 | 17 | */
|
| 18 | +#include <algorithm> |
18 | 19 | #include <stdlib.h>
|
19 | 20 |
|
20 | 21 | #include "hard_block.h"
|
@@ -55,7 +56,13 @@ t_model_ports *get_model_port(t_model_ports *ports, const char *name)
|
55 | 56 | void cache_hard_block_names()
|
56 | 57 | {
|
57 | 58 | hard_block_names = sc_new_string_cache();
|
58 |
| - for (LogicalModelId model_id : Arch.models.user_models()) { |
| 59 | + // After a change to the construction of the user models, the order was |
| 60 | + // reversed, which slightly changed the results. Reversing them back to |
| 61 | + // attain the same results. |
| 62 | + // TODO: Regenerate the golden solutions to use the new model order. |
| 63 | + std::vector<LogicalModelId> user_models(Arch.models.user_models().begin(), Arch.models.user_models().end()); |
| 64 | + std::reverse(user_models.begin(), user_models.end()); |
| 65 | + for (LogicalModelId model_id : user_models) { |
59 | 66 | t_model* hard_blocks = &Arch.models.get_model(model_id);
|
60 | 67 | int sc_spot = sc_add_string(hard_block_names, hard_blocks->name);
|
61 | 68 | hard_block_names->data[sc_spot] = (void *)hard_blocks;
|
@@ -195,7 +202,13 @@ void output_hard_blocks_yosys(Yosys::Design *design)
|
195 | 202 | {
|
196 | 203 | t_model_ports *hb_ports;
|
197 | 204 |
|
198 |
| - for (LogicalModelId model_id : Arch.models.user_models()) { |
| 205 | + // After a change to the construction of the user models, the order was |
| 206 | + // reversed, which slightly changed the results. Reversing them back to |
| 207 | + // attain the same results. |
| 208 | + // TODO: Regenerate the golden solutions to use the new model order. |
| 209 | + std::vector<LogicalModelId> user_models(Arch.models.user_models().begin(), Arch.models.user_models().end()); |
| 210 | + std::reverse(user_models.begin(), user_models.end()); |
| 211 | + for (LogicalModelId model_id : user_models) { |
199 | 212 | t_model* hard_blocks = &Arch.models.get_model(model_id);
|
200 | 213 | if (hard_blocks->used == 1) /* Hard Block is utilized */
|
201 | 214 | {
|
|
0 commit comments