URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 1482 to Rev 1483
- ↔ Reverse comparison
Rev 1482 → Rev 1483
/trunk/or1ksim/cpu/or32/op.c
50,9 → 50,6
|
#include "op_i386.h" |
|
/* FIXME: Move this */ |
#define PAGE_LEN 8192 |
|
/* |
* WARNING: Before going of and wildly editing everything in the file remember |
* the following about its contents: |
133,7 → 130,7
{ |
uint16_t reg; |
|
addr &= PAGE_SIZE - 1; |
addr &= config.immu.pagesize - 1; |
addr >>= 2; |
|
reg = dp->ts_bound[addr]; |
/trunk/or1ksim/cpu/or32/dyn_rec.c
55,9 → 55,6
|
/* FIXME: Optimise sorted list adding */ |
|
/* FIXME: remove this and use config.immu.pagesize */ |
#define PAGE_LEN 8192 |
|
typedef void (*generic_gen_op)(struct op_queue *opq, int end); |
typedef void (*imm_gen_op)(struct op_queue *opq, int end, uorreg_t imm); |
|
386,7 → 383,7
struct dyn_page *dp = malloc(sizeof(struct dyn_page)); |
dp->or_page = ADDR_PAGE(page); |
|
dp->locs = malloc(sizeof(void *) * (PAGE_LEN / 4)); |
dp->locs = malloc(sizeof(void *) * (config.immu.pagesize / 4)); |
|
dp->host_len = 0; |
dp->host_page = NULL; |
400,7 → 397,7
{ |
struct dyn_page *cur = cpu_state.dyn_pages; |
|
addr &= ~(ADDR_C(PAGE_LEN) - 1); |
addr &= ~(config.immu.pagesize - 1); |
while(cur) { |
if(cur->or_page == addr) |
return cur; |
643,7 → 640,7
cpu_state.opqs = NULL; |
|
/* Allocate the operation queue list (+1 for the page chaining) */ |
for(i = 0; i < (PAGE_LEN / 4) + 1; i++) { |
for(i = 0; i < (config.immu.pagesize / 4) + 1; i++) { |
if(!(opq = malloc(sizeof(struct op_queue)))) { |
fprintf(stderr, "OOM\n"); |
exit(1); |
909,7 → 906,7
void **loc; |
|
/* The start of the next page */ |
rec_page += PAGE_LEN; |
rec_page += config.immu.pagesize; |
|
printf("Recompileing page %"PRIxADDR"\n", rec_addr); |
fflush(stdout); |
967,7 → 964,7
dyn->dirty = 0; |
|
/* Store the state of the temporaries */ |
dyn->ts_bound[PAGE_LEN >> 2] = dyn->ts_during[j]; |
dyn->ts_bound[config.immu.pagesize >> 2] = dyn->ts_during[j]; |
|
/* Ship temporaries out to the corrisponding registers */ |
ship_gprs_out_t(opq->prev, 1, opq->reg_t); |
985,13 → 982,14
gen_code(cpu_state.opqs, dyn); |
|
/* Fix up the locations */ |
for(loc = dyn->locs; loc < &dyn->locs[PAGE_LEN / 4]; loc++) |
for(loc = dyn->locs; loc < &dyn->locs[config.immu.pagesize / 4]; loc++) |
*loc += (unsigned int)dyn->host_page; |
|
cpu_state.opqs->ops_param[0] += (unsigned int)dyn->host_page; |
|
/* Search for page-local jumps */ |
for(opq = cpu_state.opqs, j = 0; j < (PAGE_LEN / 4); opq = opq->next, j++) { |
opq = cpu_state.opqs; |
for(j = 0; j < (config.immu.pagesize / 4); opq = opq->next, j++) { |
if(opq->jump_local != -1) |
opq->ops_param[opq->jump_local] = |
(unsigned int)dyn->locs[opq->jump_local_loc >> 2]; |
1114,7 → 1112,7
if(jump_local) { |
gen_op_jmp_imm(opq, 1, 0); |
opq->jump_local = opq->num_ops_param - 1; |
opq->jump_local_loc = (opq->insn_addr + (orreg_t)off) & (PAGE_LEN - 1); |
opq->jump_local_loc = (opq->insn_addr + (orreg_t)off) & (config.immu.pagesize - 1); |
} else |
gen_op_do_jump(opq, 1); |
} |
/trunk/or1ksim/cpu/common/abstract.h
161,7 → 161,7
extern int cont_run; |
|
/* Returns the page that addr belongs to */ |
#define ADDR_PAGE(addr) ((addr) & ~(ADDR_C(PAGE_SIZE) - 1)) |
#define ADDR_PAGE(addr) ((addr) & ~(config.immu.pagesize - 1)) |
|
/* History of execution */ |
#define HISTEXEC_LEN 200 |