#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "util.h"
#include "vpr_types.h"
#include "globals.h"
#include "SetupGrid.h"
#include "read_xml_arch_file.h"
Go to the source code of this file.
void alloc_and_load_grid |
( |
INOUTP int * |
num_instances_type | ) |
|
Definition at line 22 of file SetupGrid.c.
33 if ((
nx > 32766) || (
ny > 32766)) {
34 vpr_printf(TIO_MESSAGE_ERROR,
"nx and ny must be less than 32767, since the router uses shorts (16-bit) to store coordinates.\n");
39 assert(
nx >= 1 &&
ny >= 1);
45 for (i = 0; i <= (
nx + 1); ++i) {
46 for (j = 0; j <= (
ny + 1); ++j) {
52 num_instances_type[i] = 0;
60 for (i = 1; i <=
nx; i++) {
74 for (i = 1; i <=
ny; i++) {
89 for (i = 1; i <=
nx; i++) {
91 for (j = 1; j <=
ny; j++) {
100 vpr_printf(TIO_MESSAGE_ERROR,
"in FillArch(), expected core blocks to have capacity <= 1 but (%d, %d) has type '%s' and capacity %d.\n",
117 dump =
my_fopen(
"grid_type_dump.txt",
"w", 0);
118 for (j = (
ny + 1); j >= 0; --j)
120 for (i = 0; i <= (
nx + 1); ++i)
122 fprintf(dump,
"%c",
grid[i][j].type->
name[1]);
FILE * my_fopen(const char *fname, const char *flag, int prompt)
void ** alloc_matrix(int nrmin, int nrmax, int ncmin, int ncmax, size_t elsize)
static void * my_malloc(int ibytes)
static void CheckGrid(void)
struct s_grid_tile ** grid
static t_type_ptr find_type_col(INP int x)
static void CheckGrid |
( |
void |
| ) |
|
|
static |
Definition at line 145 of file SetupGrid.c.
149 for (i = 0; i <= (
nx + 1); ++i) {
150 for (j = 0; j <= (
ny + 1); ++j) {
152 vpr_printf(TIO_MESSAGE_ERROR,
"grid[%d][%d] has no type.\n", i, j);
157 vpr_printf(TIO_MESSAGE_ERROR,
"grid[%d][%d] has non-zero usage (%d) before netlist load.\n", i, j,
grid[i][j].
usage);
163 vpr_printf(TIO_MESSAGE_ERROR,
"grid[%d][%d] has invalid offset (%d).\n", i, j,
grid[i][j].
offset);
168 && (
grid[i][j].type->capacity > 0)) {
169 vpr_printf(TIO_MESSAGE_ERROR,
"grid[%d][%d] has no block list allocated.\n", i, j);
struct s_grid_tile ** grid
Definition at line 176 of file SetupGrid.c.
181 int priority, num_loc;
193 for (j = 0; j < num_loc; j++) {
205 }
else if (repeat > 0 && x > start && start > 0) {
206 if ((x - start) % repeat == 0) {
213 if (
nint(rel *
nx) == x) {
struct s_grid_loc_def * grid_loc_def
struct s_type_descriptor * type_descriptors
static const char * match(const struct slre *, int, const char *, int, int *, struct cap *)
Definition at line 130 of file SetupGrid.c.
136 for (i = 0; i <= (
nx + 1); ++i) {
137 for (j = 0; j <= (
ny + 1); ++j) {
void free_matrix(void *vptr, int nrmin, int nrmax, int ncmin, size_t elsize)
struct s_grid_tile ** grid