亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? simple_bus.cpp

?? systemc model of a fifo channel
?? CPP
字號:
/*****************************************************************************  The following code is derived, directly or indirectly, from the SystemC  source code Copyright (c) 1996-2002 by all Contributors.  All Rights reserved.  The contents of this file are subject to the restrictions and limitations  set forth in the SystemC Open Source License Version 2.3 (the "License");  You may not use this file except in compliance with such restrictions and  limitations. You may obtain instructions on how to receive a copy of the  License at http://www.systemc.org/. Software distributed by Contributors  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF  ANY KIND, either express or implied. See the License for the specific  language governing rights and limitations under the License. *****************************************************************************//*****************************************************************************   simple_bus.cpp : The bus.                   The main_action process is active at falling clock edge.       		   Handling of the requests. A request can result in 		   different requests to slaves. These are atomic requests 		   and cannot be interrupted. A slave can take several 		   cycles to complete: each time the request has to be 		   re-issued to the slave. Once the slave transaction 		   is completed, the m_current_request is cleared, and 		   the request form is updated (address+=4, data++). 		   When m_current_request is clear, the next request is		   selected. This can be the same one, if the transfer is		   not completed (burst-mode), or it can be a request with		   a higher priority. Intrusion to a non-locked burst-mode		   transaction is possible. 		   When a transaction sets a lock, then the corresponding		   field in the request is set to SIMPLE_BUS_LOCK_SET. If		   the locked transaction is granted by the arbiter for the		   first time, the lock is set to SIMPLE_BUS_LOCK_GRANTED. 		   At the end of the transaction, the lock is set to 		   SIMPLE_BUS_LOCK_SET. If now a new locked request is made,		   with the same priority, the status of the lock is set		   to SIMPLE_BUS_LOCK_GRANTED, and the arbiter will pick		   this transaction to be the best. If the locked trans-		   action was not selected by the arbiter in the first 		   round (request with higher priority preceeded), then the		   lock is not set. After the completion of the transaction,		   the lock is set from SIMPLE_BUS_LOCK_SET (set during the		   bus-interface function), to SIMPLE_BUS_LOCK_NO. 		   		   The bus is derived from the following interfaces, and		   contains the implementation of these: 		   - blocking : burst_read/burst_write		   - non-blocking : read/write/get_status		   - direct : direct_read/direct_write   Original Author: Ric Hilderink, Synopsys, Inc., 2001-10-11  *****************************************************************************/ /*****************************************************************************   MODIFICATION LOG - modifiers, enter your name, affiliation, date and  changes you are making here.       Name, Affiliation, Date:  Description of Modification:  *****************************************************************************/#include "simple_bus.h"void simple_bus::end_of_elaboration(){  // perform a static check for overlapping memory areas of the slaves  bool no_overlap;  for (int i = 1; i < slave_port.size(); ++i) {    simple_bus_slave_if *slave1 = slave_port[i];    for (int j = 0; j < i; ++j) {      simple_bus_slave_if *slave2 = slave_port[j];       no_overlap = ( slave1->end_address() < slave2->start_address() ) ||               ( slave1->start_address() > slave2->end_address() );      if ( !no_overlap ) {        sb_fprintf(stdout,"Error: overlapping address spaces of 2 slaves : \n");        sb_fprintf(stdout,"slave %i : %0X..%0X\n",i,slave1->start_address(),slave1->end_address());         sb_fprintf(stdout,"slave %i : %0X..%0X\n",j,slave2->start_address(),slave2->end_address());        exit(0);      }    }  }}//----------------------------------------------------------------------------//-- process//----------------------------------------------------------------------------void simple_bus::main_action(){  // m_current_request is cleared after the slave is done with a  // single data transfer. Burst requests require the arbiter to  // select the request again.  if (!m_current_request)    m_current_request = get_next_request();  else    // monitor slave wait states    if (m_verbose)      sb_fprintf(stdout, "%g SLV [%d]\n", sc_simulation_time(),		 m_current_request->address);  if (m_current_request)    handle_request();  if (!m_current_request)    clear_locks();}//----------------------------------------------------------------------------//-- direct BUS interface//----------------------------------------------------------------------------bool simple_bus::direct_read(int *data, unsigned int address){  if (address%4 != 0 ) {// address not word alligned    sb_fprintf(stdout, "  BUS ERROR --> address %04X not word alligned\n",address);    return false;   }  simple_bus_slave_if *slave = get_slave(address);  if (!slave) return false;  return slave->direct_read(data, address);}bool simple_bus::direct_write(int *data, unsigned int address){  if (address%4 != 0 ) {// address not word alligned    sb_fprintf(stdout, "  BUS ERROR --> address %04X not word alligned\n",address);    return false;   }  simple_bus_slave_if *slave = get_slave(address);  if (!slave) return false;  return slave->direct_write(data, address);}//----------------------------------------------------------------------------//-- non-blocking BUS interface//----------------------------------------------------------------------------void simple_bus::read(unsigned int unique_priority		      , int *data		      , unsigned int address		      , bool lock){  if (m_verbose)    sb_fprintf(stdout, "%g %s : read(%d) @ %x\n",	       sc_simulation_time(), name(), unique_priority, address);    simple_bus_request *request = get_request(unique_priority);  // abort when the request is still not finished  sc_assert((request->status == SIMPLE_BUS_OK) ||	    (request->status == SIMPLE_BUS_ERROR));  request->do_write           = false; // we are reading  request->address            = address;  request->end_address        = address;  request->data               = data;  if (lock)    request->lock = (request->lock == SIMPLE_BUS_LOCK_SET) ?       SIMPLE_BUS_LOCK_GRANTED : SIMPLE_BUS_LOCK_SET;  request->status = SIMPLE_BUS_REQUEST;}void simple_bus::write(unsigned int unique_priority		       , int *data		       , unsigned int address		       , bool lock){  if (m_verbose)     sb_fprintf(stdout, "%g %s : write(%d) @ %x\n",	       sc_simulation_time(), name(), unique_priority, address);  simple_bus_request *request = get_request(unique_priority);  // abort when the request is still not finished  sc_assert((request->status == SIMPLE_BUS_OK) ||	    (request->status == SIMPLE_BUS_ERROR));  request->do_write           = true; // we are writing  request->address            = address;  request->end_address        = address;  request->data               = data;  if (lock)    request->lock = (request->lock == SIMPLE_BUS_LOCK_SET) ?      SIMPLE_BUS_LOCK_GRANTED : SIMPLE_BUS_LOCK_SET;  request->status = SIMPLE_BUS_REQUEST;}simple_bus_status simple_bus::get_status(unsigned int unique_priority){  return get_request(unique_priority)->status;}//----------------------------------------------------------------------------//-- blocking BUS interface//----------------------------------------------------------------------------simple_bus_status simple_bus::burst_read(unsigned int unique_priority					 , int *data					 , unsigned int start_address					 , unsigned int length					 , bool lock){  if (m_verbose)     sb_fprintf(stdout, "%g %s : burst_read(%d) @ %x\n",	       sc_simulation_time(), name(), unique_priority, start_address);	  simple_bus_request *request = get_request(unique_priority);  request->do_write           = false; // we are reading  request->address            = start_address;  request->end_address        = start_address + (length-1)*4;  request->data               = data;  if (lock)    request->lock = (request->lock == SIMPLE_BUS_LOCK_SET) ?       SIMPLE_BUS_LOCK_GRANTED : SIMPLE_BUS_LOCK_SET;  request->status = SIMPLE_BUS_REQUEST;  wait(request->transfer_done);  wait(clock->posedge_event());  return request->status;}simple_bus_status simple_bus::burst_write(unsigned int unique_priority					  , int *data					  , unsigned int start_address					  , unsigned int length					  , bool lock){  if (m_verbose)     sb_fprintf(stdout, "%g %s : burst_write(%d) @ %x\n",	       sc_simulation_time(), name(), unique_priority, start_address);	  simple_bus_request *request = get_request(unique_priority);  request->do_write           = true; // we are writing  request->address            = start_address;  request->end_address        = start_address + (length-1)*4;  request->data               = data;  if (lock)    request->lock = (request->lock == SIMPLE_BUS_LOCK_SET) ?       SIMPLE_BUS_LOCK_GRANTED : SIMPLE_BUS_LOCK_SET;  request->status = SIMPLE_BUS_REQUEST;  wait(request->transfer_done);  wait(clock->posedge_event());  return request->status;}//----------------------------------------------------------------------------//-- BUS methods:////     handle_request()   : performs atomic bus-to-slave request//     get_request()      : BUS-interface: gets the request form of given //                          priority//     get_next_request() : returns a valid request out of the list of //                          pending requests//     clear_locks()      : downgrade the lock status of the requests once//                          the transfer is done//----------------------------------------------------------------------------void simple_bus::handle_request(){  if (m_verbose)      sb_fprintf(stdout, "%g %s Handle Slave(%d)\n",		 sc_simulation_time(), name(), m_current_request->priority);  m_current_request->status = SIMPLE_BUS_WAIT;  simple_bus_slave_if *slave = get_slave(m_current_request->address);  if ((m_current_request->address)%4 != 0 ) {// address not word alligned    sb_fprintf(stdout, "  BUS ERROR --> address %04X not word alligned\n",m_current_request->address);    m_current_request->status = SIMPLE_BUS_ERROR;    m_current_request = (simple_bus_request *)0;    return;  }  if (!slave) {    sb_fprintf(stdout, "  BUS ERROR --> no slave for address %04X \n",m_current_request->address);    m_current_request->status = SIMPLE_BUS_ERROR;    m_current_request = (simple_bus_request *)0;    return;  }  simple_bus_status slave_status = SIMPLE_BUS_OK;  if (m_current_request->do_write)    slave_status = slave->write(m_current_request->data, 				m_current_request->address);  else    slave_status = slave->read(m_current_request->data,			       m_current_request->address);  if (m_verbose)    sb_fprintf(stdout, "  --> status=(%s)\n", simple_bus_status_str[slave_status]);  switch(slave_status)    {    case SIMPLE_BUS_ERROR:      m_current_request->status = SIMPLE_BUS_ERROR;      m_current_request->transfer_done.notify();      m_current_request = (simple_bus_request *)0;      break;    case SIMPLE_BUS_OK:      m_current_request->address+=4; //next word (byte addressing)      m_current_request->data++;      if (m_current_request->address > m_current_request->end_address)	{	  // burst-transfer (or single transfer) completed	  m_current_request->status = SIMPLE_BUS_OK;	  m_current_request->transfer_done.notify();	  m_current_request = (simple_bus_request *)0;	}      else	{ // more data to transfer, but the (atomic) slave transfer is done	  m_current_request = (simple_bus_request *)0;	}      break;    case SIMPLE_BUS_WAIT:      // the slave is still processing: no clearance of the current request      break;    default:      break;    }}simple_bus_slave_if *simple_bus::get_slave(unsigned int address){  for (int i = 0; i < slave_port.size(); ++i)    {      simple_bus_slave_if *slave = slave_port[i];      if ((slave->start_address() <= address) &&	  (address <= slave->end_address()))	return slave;    }  return (simple_bus_slave_if *)0;		}simple_bus_request * simple_bus::get_request(unsigned int priority){  simple_bus_request *request = (simple_bus_request *)0;  for (int i = 0; i < m_requests.size(); ++i)    {      request = m_requests[i];      if ((request) &&	  (request->priority == priority))	return request;    }  request = new simple_bus_request;  request->priority = priority;  m_requests.push_back(request);  return request;		}simple_bus_request * simple_bus::get_next_request(){  // the slave is done with its action, m_current_request is  // empty, so go over the bag of request-forms and compose  // a set of likely requests. Pass it to the arbiter for the  // final selection  simple_bus_request_vec Q;  for (int i = 0; i < m_requests.size(); ++i)    {      simple_bus_request *request = m_requests[i];      if ((request->status == SIMPLE_BUS_REQUEST) ||	  (request->status == SIMPLE_BUS_WAIT))	{	  if (m_verbose) 	    sb_fprintf(stdout, "%g %s : request (%d) [%s]\n",		       sc_simulation_time(), name(), 		       request->priority, simple_bus_status_str[request->status]);	  Q.push_back(request);	}    }  if (Q.size() > 0)    return arbiter_port->arbitrate(Q);  return (simple_bus_request *)0;}void simple_bus::clear_locks(){  for (int i = 0; i < m_requests.size(); ++i)    if (m_requests[i]->lock == SIMPLE_BUS_LOCK_GRANTED)      m_requests[i]->lock = SIMPLE_BUS_LOCK_SET;    else      m_requests[i]->lock = SIMPLE_BUS_LOCK_NO;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美国产午夜精品| 成人国产亚洲欧美成人综合网| 国产欧美日韩精品一区| 日韩一区二区麻豆国产| 日韩一区二区麻豆国产| 91精品久久久久久蜜臀| 欧美一区二区三区电影| 日韩欧美自拍偷拍| 在线观看91av| 2022国产精品视频| 日本一区二区高清| 亚洲日本va在线观看| 亚洲精品中文在线观看| 亚洲国产成人高清精品| 免费在线观看成人| 精品一区二区三区香蕉蜜桃| 久久99精品视频| 国产a视频精品免费观看| 成人高清视频在线观看| 91论坛在线播放| 日韩一区二区中文字幕| 久久久国产综合精品女国产盗摄| 国产精品美女久久久久高潮| 亚洲在线观看免费| 日本va欧美va精品| 成人av动漫网站| 在线播放91灌醉迷j高跟美女 | 中文字幕av一区二区三区高| 亚洲视频在线一区二区| 亚洲二区视频在线| 国产精品1024| 欧美性videosxxxxx| 精品国产伦一区二区三区观看体验| 欧美高清在线视频| 日本中文字幕不卡| 97精品电影院| 精品国产欧美一区二区| 夜夜精品浪潮av一区二区三区| 日本伊人色综合网| 99九九99九九九视频精品| 欧美一区二区女人| 亚洲乱码国产乱码精品精98午夜| 免费视频一区二区| 91福利区一区二区三区| 久久婷婷综合激情| 日本欧美大码aⅴ在线播放| 99久久精品国产精品久久| 日韩欧美一区电影| 亚洲综合清纯丝袜自拍| 国产成人在线网站| 日韩午夜激情视频| 亚洲成人免费在线观看| 91在线观看美女| 国产欧美1区2区3区| 久久精品国产亚洲5555| 在线看日本不卡| 中文字幕一区二区三区在线不卡| 捆绑紧缚一区二区三区视频| 91麻豆自制传媒国产之光| 欧美国产成人精品| 国产精品1024| 日本一区免费视频| 91同城在线观看| 国产欧美日韩一区二区三区在线观看 | 欧美一级二级在线观看| 亚洲在线观看免费| 在线视频一区二区三区| 亚洲视频免费在线观看| 成人免费高清在线| 欧美极品aⅴ影院| 丁香婷婷深情五月亚洲| 精品国产露脸精彩对白| 美女久久久精品| 日韩精品一区二区三区在线| 偷拍亚洲欧洲综合| 在线电影院国产精品| 喷水一区二区三区| 欧美精品一区男女天堂| 国产揄拍国内精品对白| 久久精品视频在线免费观看| 日本特黄久久久高潮| 欧美日韩成人激情| 麻豆精品在线视频| 国产日韩一级二级三级| 成人av在线资源| 一区二区三区精品视频在线| 欧美综合亚洲图片综合区| 亚洲成av人**亚洲成av**| 欧美一区二区免费视频| 韩国成人精品a∨在线观看| 久久久精品中文字幕麻豆发布| 成人午夜视频在线观看| 亚洲欧美日韩国产手机在线 | 中文字幕一区二区三区蜜月| 成人国产在线观看| 亚洲国产三级在线| 久久综合久久99| 99国产欧美另类久久久精品| 亚洲一区二区三区自拍| 日韩免费观看2025年上映的电影 | av中文字幕一区| 亚洲自拍偷拍麻豆| 欧美成人性福生活免费看| 国产成人精品1024| 一区二区三区在线影院| 717成人午夜免费福利电影| 婷婷开心激情综合| 国产精品免费人成网站| 91极品美女在线| 久久精品av麻豆的观看方式| 中文字幕在线不卡一区| 欧美一区午夜视频在线观看| 成人精品视频网站| 亚洲永久精品国产| 26uuu国产电影一区二区| 欧美sm极限捆绑bd| 91蝌蚪国产九色| 免费高清在线一区| 亚洲男人的天堂av| 精品国产污网站| 欧洲精品视频在线观看| 国产精品18久久久久久久久久久久| 国产精品视频yy9299一区| 欧美一区二区在线免费观看| 91在线免费视频观看| 男男gaygay亚洲| 亚洲韩国一区二区三区| 国产精品你懂的在线欣赏| 日韩精品中午字幕| 欧美日韩一区 二区 三区 久久精品| 激情综合一区二区三区| 天堂资源在线中文精品| 亚洲男同1069视频| 最新中文字幕一区二区三区| 日韩欧美亚洲国产精品字幕久久久 | 国产成人精品亚洲日本在线桃色| 丝袜美腿亚洲一区| 一区二区三区在线播放| 国产精品国产精品国产专区不片 | 99riav久久精品riav| 狠狠v欧美v日韩v亚洲ⅴ| 青娱乐精品在线视频| 午夜av一区二区| 伊人夜夜躁av伊人久久| 亚洲精品日产精品乱码不卡| 国产精品二区一区二区aⅴ污介绍| 久久伊人中文字幕| 久久综合视频网| 久久免费偷拍视频| 国产欧美一二三区| 国产欧美日韩在线视频| 国产午夜精品在线观看| 久久嫩草精品久久久精品一| 国产偷v国产偷v亚洲高清| 欧美一区二区人人喊爽| 91精品婷婷国产综合久久性色| 在线成人小视频| 欧美日韩国产精品自在自线| 欧美在线视频全部完| 制服丝袜亚洲色图| 精品国产精品网麻豆系列| 久久午夜老司机| 国产欧美日韩在线| 亚洲女人小视频在线观看| 亚洲中国最大av网站| 五月天丁香久久| 亚洲与欧洲av电影| 日韩电影一区二区三区四区| 蜜桃久久av一区| 国产综合色产在线精品| 岛国一区二区在线观看| 色综合久久中文综合久久97| 色婷婷av一区| 日韩写真欧美这视频| 国产精品久久午夜| 亚洲风情在线资源站| 国产在线视视频有精品| 99久久婷婷国产综合精品电影| 欧美日韩一区成人| 精品99久久久久久| 亚洲蜜臀av乱码久久精品| 天天av天天翘天天综合网 | 天堂在线亚洲视频| 国产精一品亚洲二区在线视频| 免费观看一级特黄欧美大片| 国产一区二区91| 欧美日韩在线观看一区二区| 久久综合久久鬼色| 亚洲一区视频在线| 国产在线精品免费| 欧美日韩亚洲不卡| 国产精品全国免费观看高清| 午夜不卡在线视频| 91首页免费视频| 精品福利一区二区三区 | 国产精品亚洲人在线观看| 日本电影欧美片| 国产嫩草影院久久久久| 日本不卡视频在线| 欧美午夜影院一区|