Hardware Design: SIE
Sign in or create your account | Project List | Help
Hardware Design: SIE Git Source Tree
Root/
| 1 | /** Genetic definitions **/ |
| 2 | |
| 3 | #define HW_ENABLE 0 //habilitar hw, 0 se hace por SW |
| 4 | #define VARS 8 |
| 5 | #define FUNCIONES 4 |
| 6 | #define COMBS (int) pow(2,VARS) |
| 7 | #define FUNCOMBS (int) pow(FUNCIONES + 1, 3) |
| 8 | #define FUN_NOT 0 |
| 9 | #define FUN_AND 1 |
| 10 | #define FUN_XOR 2 |
| 11 | #define FUN_OR 3 |
| 12 | #define YES FUNCIONES |
| 13 | #define NOVAR VARS |
| 14 | #define PESO_SALIDA 1 |
| 15 | #define PESO_PUERTAS 1 |
| 16 | |
| 17 | #define MAXGENERACIONES 32 |
| 18 | #define RESULTADOS 4 |
| 19 | |
| 20 | /* Numero de generaciones en el que se amplia la logitud del cromosoma*/ |
| 21 | #define UMBRAL_GENERACION (int) pow(3, pentarboles) * 5000 |
| 22 | #define MAX_PENTARBOLES 16 |
| 23 | |
| 24 | #define POBLACION 4 |
| 25 | #define ARBOLES 5 |
| 26 | #define LONG_ARBOL 8 |
| 27 | |
| 28 | |
| 29 | |
| 30 | /* |
| 31 | POBLACION define el numero de individuos. minimo 6. 2 padres 4 taras |
| 32 | ARBOLES define el numero de arboles en un individuo. Cada arbol tiene 3 funciones 4 variables. |
| 33 | INDICES_XXX define el desplazamiento de un individuo en el cromosoma completo de la poblacion, cromo |
| 34 | */ |
| 35 | |
| 36 | #define nivel1 pentarboles * 4 |
| 37 | #define ARBOLES_INDIV (int)(nivel1 + nivel2(pentarboles) + nivel3(pentarboles) + nivel4(pentarboles) + nivel5(pentarboles)) |
| 38 | #define LONG_INDIV (int)(ARBOLES_INDIV * LONG_ARBOL) |
| 39 | |
| 40 | #define INDICE_PADRE1 ((*ordenpoblacion) * LONG_INDIV) |
| 41 | #define INDICE_PADRE2 ((*(ordenpoblacion+1)) * LONG_INDIV) |
| 42 | |
| 43 | #define INDICE_TARA1 ((*(ordenpoblacion+POBLACION-1)) * LONG_INDIV) |
| 44 | #define INDICE_TARA2 ((*(ordenpoblacion+POBLACION-2)) * LONG_INDIV) |
| 45 | #define INDICE_TARA3 ((*(ordenpoblacion+POBLACION-3)) * LONG_INDIV) |
| 46 | #define INDICE_TARA4 ((*(ordenpoblacion+POBLACION-4)) * LONG_INDIV) |
| 47 | |
| 48 | |
| 49 | |
| 50 | /************************** peripheral Definitions ***************************/ |
| 51 | #define EVALFIT_PHYSBASE 0xcd800000 |
| 52 | #define USR_REGS 0x10 |
| 53 | #define MAP_SIZE 0x4000Ul |
| 54 | #define MAP_MASK (MAP_SIZE - 1) |
| 55 | |
| 56 | #define DONE_MASK 0x1 |
| 57 | #define ERRORS_MASK 0xFFFF |
| 58 | |
| 59 | |
| 60 | |
| 61 | /** CONTROL REGISTERS **/ |
| 62 | #define EVALFIT_REGBASE_OFFSET 0 |
| 63 | |
| 64 | #define EVALFIT_CONTROL_OFFSET EVALFIT_REGBASE_OFFSET + 0 |
| 65 | #define CONTROL_RESET_MASK 0x80000000 |
| 66 | #define CONTROL_START_MASK 0x40000000 |
| 67 | |
| 68 | #define EVALFIT_STATUS_OFFSET EVALFIT_REGBASE_OFFSET + 0 |
| 69 | #define EVALFIT_SRCADDR_OFFSET EVALFIT_REGBASE_OFFSET + 4 |
| 70 | #define EVALFIT_DSTADDR_OFFSET EVALFIT_REGBASE_OFFSET + 8 |
| 71 | #define EVALFIT_TRANSFERSIZE_OFFSET EVALFIT_REGBASE_OFFSET + 12 |
| 72 | #define EVALFIT_REG_OFFSET EVALFIT_REGBASE_OFFSET + 16 |
| 73 | |
| 74 | /** WRITE REGISTERS **/ |
| 75 | #define EVALFIT_WREG4 (EVALFIT_REGBASE_OFFSET + (4*4)) |
| 76 | #define EVALFIT_WREG5 (EVALFIT_REGBASE_OFFSET + (4*5)) |
| 77 | #define EVALFIT_wREG6 (EVALFIT_REGBASE_OFFSET + (4*6)) |
| 78 | #define EVALFIT_wREG7 (EVALFIT_REGBASE_OFFSET + (4*7)) |
| 79 | #define EVALFIT_wREG8 (EVALFIT_REGBASE_OFFSET + (4*8)) |
| 80 | |
| 81 | /** READ REGISTERS **/ |
| 82 | #define EVALFIT_RDREG0 (EVALFIT_REGBASE_OFFSET) |
| 83 | #define EVALFIT_RDREG1 (EVALFIT_REGBASE_OFFSET + (4*1)) |
| 84 | #define EVALFIT_RDREG2 (EVALFIT_REGBASE_OFFSET + (4*2)) |
| 85 | #define EVALFIT_RDREG3 (EVALFIT_REGBASE_OFFSET + (4*3)) |
| 86 | #define EVALFIT_RDREG4 (EVALFIT_REGBASE_OFFSET + (4*4)) |
| 87 | #define EVALFIT_RDREG5 (EVALFIT_REGBASE_OFFSET + (4*5)) |
| 88 | #define EVALFIT_RDREG6 (EVALFIT_REGBASE_OFFSET + (4*6)) |
| 89 | #define EVALFIT_RDREG7 (EVALFIT_REGBASE_OFFSET + (4*7)) |
| 90 | |
| 91 | /** MEMORY **/ |
| 92 | #define EVALFIT_MEMOFFSET 0x1000 |
| 93 | #define EVALFIT_OBJOFFSET EVALFIT_MEMOFFSET + (0x40 * 8) |
| 94 | |
| 95 | /** CROMOSOMA **/ |
| 96 | #define CROMO_NIVEL_OFFSET |
| 97 | |
| 98 |
Branches:
master
