Beispiel #1
0
// *****************************************************************************
void hit_generator_tb::check_output()
{
    while(1)
    {
        wait();

        for (auto& hit_signal: hit_signals)
        {
            stub read_stub(configuration.output_stub_mpa);
            while (hit_signal.nb_read(read_stub))
            {
                std::pair<bool, sc_map_list_key<chip_address> > signal_key;
                signal_key = hit_signals.get_key(hit_signal);
                chip_address chp_address = signal_key.second.value;
                log_buffer << sc_time_stamp () << std::dec
                           << " @ hit_generator." << chp_address;

                if (read_stub.configuration.pixel_bits > 1)
                {
                    log_buffer << " (PS): "
                               << read_stub.get_strip() << ","
                               << read_stub.get_pixel() << " - "
                               << read_stub.get_bend() << std::endl;
                }
                else
                {
                    log_buffer << " (2S): " << std::hex
                               << read_stub.get_strip() << " - "
                               << read_stub.get_bend() << std::endl;
                }
            }
        }
    }

}
Beispiel #2
0
int stub_retrieve(char *name)					/*;stub_retrieve*/
{
	char	*fname;
	Tuple	stubtup, tup;
	int		si, n, i;

	/*
	 * Reads, if necessary, information from the file in which the stub
	 * 'name' was declared.
	 */
#ifdef TBSN
	if (putdebug) TO_ERRFILE(strjoin("STUB_RETRIEVE ", name));
#endif
	fname = lib_stub_get(name);
	if (fname == NULL) return FALSE;
	if (!streq(fname, AISFILENAME)) {
		si = stub_numbered(name);
		stubtup = (Tuple) stub_info[si];
		tup = (Tuple) stubtup[4];
		n = tup_size(tup);
		for (i = 1;i <= n; i++) {
		 	retrieve(pUnits[(int)tup[i]]->name);
		}
		if (!read_stub(fname, name, "st1")) return FALSE;
	}
	return TRUE;
}