aboutsummaryrefslogtreecommitdiffstats
path: root/examples/anlogic/demo.v
blob: e17db771ea047113621efd27882fc514de2c4904 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module demo (
    input wire CLK_IN,
    output wire R_LED
);
    parameter time1 = 30'd12_000_000;
    reg led_state;
    reg [29:0] count;

    always @(posedge CLK_IN)begin
        if(count == time1)begin
            count<= 30'd0;
            led_state <= ~led_state;
        end
        else
            count <= count + 1'b1;
    end
    assign R_LED = led_state;
endmodule
"cm"> * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "xc_private.h" int xc_mem_event_control(xc_interface *xch, domid_t domain_id, unsigned int op, unsigned int mode, uint32_t *port) { DECLARE_DOMCTL; int rc; domctl.cmd = XEN_DOMCTL_mem_event_op; domctl.domain = domain_id; domctl.u.mem_event_op.op = op; domctl.u.mem_event_op.mode = mode; rc = do_domctl(xch, &domctl); if ( !rc && port ) *port = domctl.u.mem_event_op.port; return rc; } int xc_mem_event_memop(xc_interface *xch, domid_t domain_id, unsigned int op, unsigned int mode, uint64_t gfn, void *buffer) { xen_mem_event_op_t meo; memset(&meo, 0, sizeof(meo)); meo.op = op; meo.domain = domain_id; meo.gfn = gfn; meo.buffer = (unsigned long) buffer; return do_memory_op(xch, mode, &meo, sizeof(meo)); }