Connect CPU to thread channels directly
Avoids double updating of the tracking mux, as the CPU mux already implements the filtering and select operations.
This commit is contained in:
parent
c43caccfd4
commit
70ad9e86aa
@ -22,8 +22,9 @@ init_chan(struct model_cpu *cpu, const struct model_chan_spec *spec, int64_t gin
|
|||||||
|
|
||||||
const char *name = cpu->spec->model->name;
|
const char *name = cpu->spec->model->name;
|
||||||
const char *ch_name = spec->ch_names[i];
|
const char *ch_name = spec->ch_names[i];
|
||||||
|
int track_mode = spec->track[i];
|
||||||
|
|
||||||
if (track_init(track, cpu->bay, TRACK_TYPE_TH, "%s.cpu%ld.%s",
|
if (track_init(track, cpu->bay, TRACK_TYPE_TH, track_mode, "%s.cpu%ld.%s",
|
||||||
name, gindex, ch_name) != 0) {
|
name, gindex, ch_name) != 0) {
|
||||||
err("track_init failed");
|
err("track_init failed");
|
||||||
return -1;
|
return -1;
|
||||||
@ -84,7 +85,9 @@ connect_cpu(struct emu *emu, struct cpu *scpu, int id)
|
|||||||
* TRACK_TH_RUN allowed, as active may cause collisions) */
|
* TRACK_TH_RUN allowed, as active may cause collisions) */
|
||||||
int mode = chan_spec->track[i];
|
int mode = chan_spec->track[i];
|
||||||
struct chan *sel = cpu_get_th_chan(scpu, mode);
|
struct chan *sel = cpu_get_th_chan(scpu, mode);
|
||||||
if (track_set_select(track, mode, sel, NULL) != 0) {
|
|
||||||
|
int64_t nthreads = emu->system.nthreads;
|
||||||
|
if (track_set_select(track, sel, NULL, nthreads) != 0) {
|
||||||
err("track_select failed");
|
err("track_select failed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -93,19 +96,14 @@ connect_cpu(struct emu *emu, struct cpu *scpu, int id)
|
|||||||
for (struct thread *t = emu->system.threads; t; t = t->gnext) {
|
for (struct thread *t = emu->system.threads; t; t = t->gnext) {
|
||||||
struct model_thread *th = EXT(t, id);
|
struct model_thread *th = EXT(t, id);
|
||||||
|
|
||||||
/* Choose input channel from the thread output channels
|
/* Use the input thread directly */
|
||||||
* based on CPU tracking mode */
|
struct chan *inp = &th->ch[i];
|
||||||
struct value key = value_int64(t->gindex);
|
|
||||||
struct chan *inp = track_get_output(&th->track[i], mode);
|
|
||||||
|
|
||||||
if (track_add_input(track, mode, key, inp) != 0) {
|
if (track_set_input(track, t->gindex, inp) != 0) {
|
||||||
err("track_add_input failed");
|
err("track_add_input failed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the PRV output */
|
|
||||||
track_set_default(track, mode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user