/* * Copyright (c) 2002 moe * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU * General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ // UDIV64 test bench // C++ version #include #include #include "UDIV64.hh" int main() { //////////////////////////////////////////////////////////////////////// moe::UDIV64 udiv64; //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// uint64_t a,b; int ai,bi,i; uint64_t ref_UDIV; uint64_t am,bm; // udiv64.RSTn_negedge(); for( ai=0;ai<=64;ai=ai+1 ) { if( ai==64 ) am =0; else am =(~0ULL)>>(63-ai); for( bi=0;bi<64;bi=bi+1 ) { bm =(~0ULL)>>(63-bi); for( i=0;i<10000;i=i+1 ) { a =(1ULL<