lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1 | // Copyright lowRISC contributors. |
| 2 | // Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| 3 | // SPDX-License-Identifier: Apache-2.0 |
| 4 | |
| 5 | class ${name}_host_driver extends ${name}_driver; |
| 6 | `uvm_component_utils(${name}_host_driver) |
| 7 | |
| 8 | // the base class provides the following handles for use: |
| 9 | // ${name}_agent_cfg: cfg |
| 10 | |
| 11 | `uvm_component_new |
| 12 | |
| 13 | virtual task run_phase(uvm_phase phase); |
| 14 | // base class forks off reset_signals() and get_and_drive() tasks |
| 15 | super.run_phase(phase); |
| 16 | endtask |
| 17 | |
| 18 | // reset signals |
| 19 | virtual task reset_signals(); |
| 20 | endtask |
| 21 | |
| 22 | // drive trans received from sequencer |
| 23 | virtual task get_and_drive(); |
| 24 | forever begin |
| 25 | seq_item_port.get_next_item(req); |
| 26 | $cast(rsp, req.clone()); |
| 27 | rsp.set_id_info(req); |
| 28 | `uvm_info(`gfn, $sformatf("rcvd item:\n%0s", req.sprint()), UVM_HIGH) |
| 29 | // TODO: do the driving part |
| 30 | // |
| 31 | // send rsp back to seq |
| 32 | `uvm_info(`gfn, "item sent", UVM_HIGH) |
| 33 | seq_item_port.item_done(rsp); |
| 34 | end |
| 35 | endtask |
| 36 | |
| 37 | endclass |