package adlsim; /** *
Title:
*Description:
*Copyright: Copyright (c) 2002
*Company:
* @author unascribed * @version 1.0 */ import java.io.*; public class VCD { ADLSimulator MCU= new ADLSimulator(); FileOutputStream f; //Return a string representing the binary equivalent of n public String decimalToBinary(int n){ String S = ""; for(int i = 31; i>=0; i--){ if(MCU.getBit(n,i)) S = S + "1"; else S = S + "0"; } return S; } //Return a string representing the binary equivalent of n public String decimalToBinary(long n){ String S = ""; for(int i = 63; i>=0; i--){ if(MCU.getBit(n,i)) S = S + "1"; else S = S + "0"; } return S; } /*******OVERLOADED METHOD**************/ //Create a VCD file given an array of values and a file name public void makeVCD(String[] vars,String[]varsLogic,long[][] val,boolean[][] valLogic, String S){ try{ f = new FileOutputStream(S); PrintStream pr = new PrintStream(f); pr.println("$timescale"); pr.println("1 ns"); pr.println("$end"); for(int i=0;i