OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [src_c/] [jtag/] [jtag_libusb/] [jinfo.c] - Blame information for rev 38

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 alirezamon
/* Copyright 2012 Brian Swetland <swetland@frotz.net>
2
 *
3
 * Licensed under the Apache License, Version 2.0 (the "License");
4
 * you may not use this file except in compliance with the License.
5
 * You may obtain a copy of the License at
6
 *
7
 *     http://www.apache.org/licenses/LICENSE-2.0
8
 *
9
 * Unless required by applicable law or agreed to in writing, software
10
 * distributed under the License is distributed on an "AS IS" BASIS,
11
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 * See the License for the specific language governing permissions and
13
 * limitations under the License.
14
 */
15
 
16
#include <stdio.h>
17
#include "jtag.h"
18
 
19
#define VENDOR_ID      0x09fb   // Altera
20
#define PRODUCT_ID     0x6001   // usb blaster (DE2-115) 
21
// Altera usb blaster  product IDs "6001", "6002", "6003", MODE="0666"   
22
// dose not work for USB-Blaster II "6010", "6810"
23
// run ./list_usb_dev  to see the list of all usb devices' vid and pid
24
 
25
unsigned usb_blaster_id = PRODUCT_ID;
26
 
27
 
28
int main(int argc, char **argv) {
29
        unsigned bits;
30
 
31
        if (jtag_open(VENDOR_ID,usb_blaster_id) < 0)
32
                return -1;
33
 
34
        if (jtag_reset() < 0)
35
                return -1;
36
 
37
        if (jtag_dr(32, 0, &bits) < 0)
38
                return -1;
39
        fprintf(stderr,"IDCODE: %08x\n", bits);
40
 
41
        if (jtag_open_virtual_device(0xffffffff,VENDOR_ID,usb_blaster_id))
42
                return -1;
43
 
44
        jtag_close();
45
        return 0;
46
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.