TDGTSMOR2BCLX2.v 2.96 KB
// VERSION:1.01 DATE:01/04/06 OPENCAD Verilog LIBRARY
`timescale 1ps / 1ps
`celldefine
`ifdef verifault
    `suppress_faults
    `enable_portfaults
`endif

module TDGTSMOR2BCLX2 ( N01, H01, H02, H03 );

    input H01;
    input H02;
    input H03;
    output N01;
	reg _N01;

    reg notifier;

    // Dummy Buffer
    buf ( _H01, H01 );
    buf ( _H02, H02 );
    buf ( _H03, H03 );

	buf (N01, _N01);

    or ( _enl, _H01, _H03 );
    not ( _enlB, _enl );
    // or ( N01, _enlB, _H02 );

	always @ ( notifier ) begin
		_N01=1'bx;
	end

	always @ ( _H02 ) begin
		casez ( {_enlB,_H02} )
		2'b?1 : _N01=1;
		2'b?0 : begin
			if ( $time !== 0 ) begin
				if (_N01===1'bx) _N01=1'bx;
				else _N01=_enlB;
			end
			else begin
				_N01=_enlB;
			end
		end
		2'b1x : begin
			if ( _N01===1'bx) _N01=1'bx;
            else _N01=1;
		end
		2'b0x : begin
            _N01=1'bx;
		end
		default : _N01=1'bx;
		endcase

	end

	always @ ( _H01 ) begin
		if ( $time !== 0 )
		if ((_H03!==1'b1)&&(_H02 !== 1'b1)) begin
			$display("");
			$display($time,,"<Warning> : %m");
			$display("\t\tChanged H01 while H02 is low.");
			$display("\t\tN01 contents set to X.\n");
			_N01=1'bx;
		end
	end

	always @ ( _H03 ) begin
		if ( $time !== 0 )
		if ((_H01!==1'b1)&&(_H02 !== 1'b1)) begin
			$display("");
			$display($time,,"<Warning> : %m");
			$display("\t\tChanged H03 while H02 is low.");
			$display("\t\tN01 contents set to X.\n");
			_N01=1'bx;
		end
	end

	wire docheck1=(_H03!==1'b1);
	wire docheck2=(_H01!==1'b1);

    specify
        specparam DMY_SPC=1;

        $setup ( posedge H01, negedge H02 &&& docheck1, DMY_SPC, notifier );
        $setup ( negedge H01, negedge H02 &&& docheck1, DMY_SPC, notifier );
        $setup ( posedge H01, posedge H02 &&& docheck1, DMY_SPC, notifier );
        $setup ( negedge H01, posedge H02 &&& docheck1, DMY_SPC, notifier );

        $hold ( posedge H02, posedge H01 &&& docheck1, DMY_SPC, notifier );
        $hold ( posedge H02, negedge H01 &&& docheck1, DMY_SPC, notifier );
        $hold ( negedge H02, posedge H01 &&& docheck1, DMY_SPC, notifier );
        $hold ( negedge H02, negedge H01 &&& docheck1, DMY_SPC, notifier );

        $setup ( posedge H03, negedge H02 &&& docheck2, DMY_SPC, notifier );
        $setup ( negedge H03, negedge H02 &&& docheck2, DMY_SPC, notifier );
        $setup ( posedge H03, posedge H02 &&& docheck2, DMY_SPC, notifier );
        $setup ( negedge H03, posedge H02 &&& docheck2, DMY_SPC, notifier );

        $hold ( posedge H02, posedge H03 &&& docheck2, DMY_SPC, notifier );
        $hold ( posedge H02, negedge H03 &&& docheck2, DMY_SPC, notifier );
        $hold ( negedge H02, posedge H03 &&& docheck2, DMY_SPC, notifier );
        $hold ( negedge H02, negedge H03 &&& docheck2, DMY_SPC, notifier );

        ( H01 *> N01 ) = ( DMY_SPC, DMY_SPC );
        ( H02 *> N01 ) = ( DMY_SPC, DMY_SPC );
        ( H03 *> N01 ) = ( DMY_SPC, DMY_SPC );
    endspecify

endmodule
`ifdef verifault
    `nosuppress_faults
    `disable_portfaults
`endif
`endcelldefine