Skip to content

Commit

Permalink
Added an elk mode to tune the data bus sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
hoglet67 committed Nov 24, 2017
1 parent 20ee040 commit 85e5341
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ int do_emulate = 0;

#define MACHINE_DEFAULT 0
#define MACHINE_MASTER 1
#define MACHINE_ELK 2

const char *machine_names[] = {
"default",
"master",
"elk",
0
};

Expand Down Expand Up @@ -871,7 +873,17 @@ void decode(FILE *stream) {
if (idx_rdy >= 0) {
pin_rdy = (last_sample >> idx_rdy) & 1;
}
if (arguments.machine == MACHINE_MASTER) {
// TODO: try to rationalize this!
if (arguments.machine == MACHINE_ELK) {
// Data bus sampling for the Elk
if (pin_rnw) {
// sample read data just before falling edge of Phi2
bus_data = last_sample & 255;
} else {
// sample write data one cycle earlier
bus_data = last_sample & 255;
}
} else if (arguments.machine == MACHINE_MASTER) {
// Data bus sampling for the Master
if (pin_rnw) {
// sample read data just before falling edge of Phi2
Expand Down

0 comments on commit 85e5341

Please sign in to comment.