Пример #1
0
void frm_uop_list_free(struct list_t *uop_list)
{
	struct frm_uop_t *uop;
	while (list_count(uop_list))
	{
		uop = list_head(uop_list);
		list_remove(uop_list, uop);
		frm_uop_free(uop);
	}
}
Пример #2
0
void frm_vector_mem_complete(struct frm_vector_mem_unit_t *vector_mem)
{
	struct frm_uop_t *uop = NULL;
	int list_entries;
	int i;
	int list_index = 0;

	/* Process completed memory instructions */
	list_entries = list_count(vector_mem->write_buffer);

	/* Sanity check the write buffer */
	assert(list_entries <= frm_gpu_vector_mem_width);

	for (i = 0; i < list_entries; i++)
	{
		uop = list_get(vector_mem->write_buffer, list_index);
		assert(uop);

		/* Uop is not ready */
		if (asTiming(frm_gpu)->cycle < uop->write_ready)
		{
			list_index++;
			continue;
		}

		/* Access complete, remove the uop from the queue */
		list_remove(vector_mem->write_buffer, uop);

		assert(uop->warp_inst_queue_entry->lgkm_cnt > 0);
		uop->warp_inst_queue_entry->lgkm_cnt--;

		frm_trace("si.end_inst id=%lld cu=%d\n", uop->id_in_sm,
			uop->sm->id);

		/* Free uop */
		frm_uop_free(uop);

		/* Statistics */
		vector_mem->inst_count++;
		frm_gpu->last_complete_cycle = asTiming(frm_gpu)->cycle;
	}
}