00001 // 00002 // ------------------------------------------------------------- 00003 // Copyright 2004-2008 Synopsys, Inc. 00004 // All Rights Reserved Worldwide 00005 // 00006 // Licensed under the Apache License, Version 2.0 (the 00007 // "License"); you may not use this file except in 00008 // compliance with the License. You may obtain a copy of 00009 // the License at 00010 // 00011 // http://www.apache.org/licenses/LICENSE-2.0 00012 // 00013 // Unless required by applicable law or agreed to in 00014 // writing, software distributed under the License is 00015 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 00016 // CONDITIONS OF ANY KIND, either express or implied. See 00017 // the License for the specific language governing 00018 // permissions and limitations under the License. 00019 // ------------------------------------------------------------- 00020 // 00021 00022 00023 `ifndef VMM_RAL_TEST_PRE_INCLUDE 00024 `define VMM_RAL_TEST_PRE_INCLUDE ral_env.svh 00025 `endif 00026 00027 `include "vmm.sv" 00028 00029 `include `VMM_MACRO_TO_STRING(`VMM_RAL_TEST_PRE_INCLUDE) 00030 00031 program shared_access; 00032 00033 `ifdef VMM_RAL_TEST_POST_INCLUDE 00034 `include `VMM_MACRO_TO_STRING(`VMM_RAL_TEST_POST_INCLUDE) 00035 `endif 00036 00037 `ifndef RAL_TB_ENV 00038 `define RAL_TB_ENV tb_env 00039 `endif 00040 00041 00042 vmm_log log = new("Shared Access", "Test"); 00043 `RAL_TB_ENV env; 00044 00045 vmm_ral_tests _vmm_ral_tests = new; 00046 00047 initial 00048 begin 00049 vmm_ral_block_or_sys ral_model; 00050 vmm_ral_block blk; 00051 vmm_ral_block blks[]; 00052 string domains[]; 00053 00054 env = new; 00055 00056 ral_model = env.ral.get_model(); 00057 if (ral_model == null) begin 00058 `vmm_fatal(log, "No RAL abstraction model was specified"); 00059 end 00060 00061 env.reset_dut(); 00062 ral_model.reset(); 00063 00064 // Test each block in turn 00065 00066 if ($cast(blk, ral_model)) begin 00067 // Blocks with some attributes are not to be tested 00068 if (blk.get_attribute("NO_RAL_TESTS") == "" && 00069 blk.get_attribute("NO_SHARED_ACCESS_TEST") == "") begin 00070 00071 _vmm_ral_tests.shared_access(blk, log); 00072 end 00073 end 00074 else begin 00075 vmm_ral_sys sys; 00076 int blks_size; 00077 $cast(sys, ral_model); 00078 sys.get_all_blocks(blks, domains); 00079 00080 // Uniquify the blocks (the same block could be in >1 domains) 00081 blks_size = blks.size(); 00082 foreach (blks[i]) begin 00083 if (i < blks_size-1) begin 00084 for (int j = i + 1; j < blks_size; j++) begin 00085 if (blks[i] == blks[j]) blks[j] = null; 00086 end 00087 end 00088 end 00089 00090 foreach (blks[i]) begin 00091 if (blks[i] == null) continue; 00092 00093 // Blocks with some attributes are not to be tested 00094 if (blks[i].get_attribute("NO_RAL_TESTS") != "" || 00095 blks[i].get_attribute("NO_SHARED_ACCESS_TEST") != "") continue; 00096 00097 _vmm_ral_tests.shared_access(blks[i], log); 00098 end 00099 end 00100 00101 log.report(); 00102 end 00103 endprogram: shared_access
![]() Intelligent Design Verification Project: VMM, Revision: 1.1.1 |
Copyright (c) 2008-2010 Intelligent Design Verification. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included here: http://www.intelligentdv.com/licenses/fdl.txt |
![]() Doxygen Version: 1.6.3 IDV SV Filter Version: 2.6.3 Sat Jun 19 12:06:47 2010 |