📄 test_directed.sv
字号:
// // -------------------------------------------------------------// Copyright 2004-2008 Synopsys, Inc.// All Rights Reserved Worldwide// // Licensed under the Apache License, Version 2.0 (the// "License"); you may not use this file except in// compliance with the License. You may obtain a copy of// the License at// // http://www.apache.org/licenses/LICENSE-2.0// // Unless required by applicable law or agreed to in// writing, software distributed under the License is// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR// CONDITIONS OF ANY KIND, either express or implied. See// the License for the specific language governing// permissions and limitations under the License.// -------------------------------------------------------------// `include "timescale.v"`include "../tb_env.sv"// Example 5-24constraint eth_frame::test_constraints1 {`ifndef NO_SIZE_IN_CONSTRAINT data.size() == min_len;`endif}program test_directed;tb_env env = new;initialbegin env.gen_cfg(); env.cfg.run_for_n_tx_frames = 99; env.cfg.run_for_n_rx_frames = 99; env.cfg.mac.promiscuous = 1; // Example 5-11 env.start(); env.host_src.stop_xactor(); env.phy_src.stop_xactor(); fork directed_stimulus; join_none env.run();endtask directed_stimulus; eth_frame to_phy, to_mac; bit dropped; repeat (100) @(negedge tb_top.tx_clk); // Example 5-13 to_phy = new; to_phy.randomize(); $cast(to_mac, to_phy.copy()); fork env.host_src.inject(to_phy, dropped); begin // Force a collision @ (posedge tb_top.mii.tx_en); env.phy_src.inject(to_mac, dropped); end join repeat (1000) @(negedge tb_top.tx_clk); -> env.end_test;endtask: directed_stimulusendprogram: test_directed
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -