commit
4e701669b7
14
.travis.yml
14
.travis.yml
|
@ -5,6 +5,7 @@ matrix:
|
||||||
include:
|
include:
|
||||||
- os: linux
|
- os: linux
|
||||||
env: BUILD=x86_64-linux-gnu
|
env: BUILD=x86_64-linux-gnu
|
||||||
|
compiler: gcc
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
env: BUILD=i686-linux-gnu CFLAGS=-m32
|
env: BUILD=i686-linux-gnu CFLAGS=-m32
|
||||||
|
@ -12,6 +13,19 @@ matrix:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- gcc-multilib
|
- gcc-multilib
|
||||||
|
compiler: gcc
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
env: BUILD=x86_64-linux-gnu
|
||||||
|
compiler: clang
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
env: BUILD=i686-linux-gnu CFLAGS=-m32
|
||||||
|
compiler: clang
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- gcc-multilib
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./bootstrap && ./configure && make
|
- ./bootstrap && ./configure && make
|
||||||
|
|
|
@ -103,7 +103,7 @@ size_t riscv_batch_add_dmi_read(struct riscv_batch *batch, unsigned address)
|
||||||
batch->read_keys[batch->read_keys_used] = batch->used_scans - 1;
|
batch->read_keys[batch->read_keys_used] = batch->used_scans - 1;
|
||||||
LOG_DEBUG("read key %u for batch 0x%p is %u (0x%p)",
|
LOG_DEBUG("read key %u for batch 0x%p is %u (0x%p)",
|
||||||
(unsigned) batch->read_keys_used, batch, (unsigned) (batch->used_scans - 1),
|
(unsigned) batch->read_keys_used, batch, (unsigned) (batch->used_scans - 1),
|
||||||
(uint64_t*)batch->data_in + (batch->used_scans + 1));
|
batch->data_in + sizeof(uint64_t) * (batch->used_scans + 1));
|
||||||
return batch->read_keys_used++;
|
return batch->read_keys_used++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,8 +112,15 @@ uint64_t riscv_batch_get_dmi_read(struct riscv_batch *batch, size_t key)
|
||||||
assert(key < batch->read_keys_used);
|
assert(key < batch->read_keys_used);
|
||||||
size_t index = batch->read_keys[key];
|
size_t index = batch->read_keys[key];
|
||||||
assert(index <= batch->used_scans);
|
assert(index <= batch->used_scans);
|
||||||
uint64_t *addr = ((uint64_t *)(batch->data_in) + index);
|
uint8_t *base = batch->data_in + 8 * index;
|
||||||
return *addr;
|
return base[0] |
|
||||||
|
((uint64_t) base[1]) << 8 |
|
||||||
|
((uint64_t) base[2]) << 16 |
|
||||||
|
((uint64_t) base[3]) << 24 |
|
||||||
|
((uint64_t) base[4]) << 32 |
|
||||||
|
((uint64_t) base[5]) << 40 |
|
||||||
|
((uint64_t) base[6]) << 48 |
|
||||||
|
((uint64_t) base[7]) << 56;
|
||||||
}
|
}
|
||||||
|
|
||||||
void riscv_batch_add_nop(struct riscv_batch *batch)
|
void riscv_batch_add_nop(struct riscv_batch *batch)
|
||||||
|
|
|
@ -23,8 +23,8 @@ struct riscv_batch {
|
||||||
|
|
||||||
size_t idle_count;
|
size_t idle_count;
|
||||||
|
|
||||||
char *data_out;
|
uint8_t *data_out;
|
||||||
char *data_in;
|
uint8_t *data_in;
|
||||||
struct scan_field *fields;
|
struct scan_field *fields;
|
||||||
|
|
||||||
/* In JTAG we scan out the previous value's output when performing a
|
/* In JTAG we scan out the previous value's output when performing a
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -478,7 +478,7 @@ riscv_addr_t riscv_program_gah(struct riscv_program *p, riscv_addr_t addr)
|
||||||
|
|
||||||
riscv_addr_t riscv_program_gal(struct riscv_program *p, riscv_addr_t addr)
|
riscv_addr_t riscv_program_gal(struct riscv_program *p, riscv_addr_t addr)
|
||||||
{
|
{
|
||||||
return ((addr > 0) ? 1 : 0) * (abs(addr) & 0x7FF);
|
return ((addr > 0) ? 1 : 0) * (addr & 0x7FF);
|
||||||
}
|
}
|
||||||
|
|
||||||
int riscv_program_lah(struct riscv_program *p, enum gdb_regno d, riscv_addr_t addr)
|
int riscv_program_lah(struct riscv_program *p, enum gdb_regno d, riscv_addr_t addr)
|
||||||
|
|
|
@ -217,7 +217,7 @@ static void decode_dmi(char *text, unsigned address, unsigned data)
|
||||||
{ DMI_DMSTATUS, DMI_DMSTATUS_ANYHALTED, "anyhalted" },
|
{ DMI_DMSTATUS, DMI_DMSTATUS_ANYHALTED, "anyhalted" },
|
||||||
{ DMI_DMSTATUS, DMI_DMSTATUS_AUTHENTICATED, "authenticated" },
|
{ DMI_DMSTATUS, DMI_DMSTATUS_AUTHENTICATED, "authenticated" },
|
||||||
{ DMI_DMSTATUS, DMI_DMSTATUS_AUTHBUSY, "authbusy" },
|
{ DMI_DMSTATUS, DMI_DMSTATUS_AUTHBUSY, "authbusy" },
|
||||||
{ DMI_DMSTATUS, DMI_DMSTATUS_CFGSTRVALID, "cfgstrvalid" },
|
{ DMI_DMSTATUS, DMI_DMSTATUS_DEVTREEVALID, "devtreevalid" },
|
||||||
{ DMI_DMSTATUS, DMI_DMSTATUS_VERSION, "version" },
|
{ DMI_DMSTATUS, DMI_DMSTATUS_VERSION, "version" },
|
||||||
|
|
||||||
{ DMI_ABSTRACTCS, DMI_ABSTRACTCS_PROGSIZE, "progsize" },
|
{ DMI_ABSTRACTCS, DMI_ABSTRACTCS_PROGSIZE, "progsize" },
|
||||||
|
@ -421,7 +421,6 @@ static uint64_t dmi_read(struct target *target, uint16_t address)
|
||||||
{
|
{
|
||||||
select_dmi(target);
|
select_dmi(target);
|
||||||
|
|
||||||
uint64_t value;
|
|
||||||
dmi_status_t status;
|
dmi_status_t status;
|
||||||
uint16_t address_in;
|
uint16_t address_in;
|
||||||
|
|
||||||
|
@ -429,7 +428,7 @@ static uint64_t dmi_read(struct target *target, uint16_t address)
|
||||||
|
|
||||||
// This first loop ensures that the read request was actually sent
|
// This first loop ensures that the read request was actually sent
|
||||||
// to the target. Note that if for some reason this stays busy,
|
// to the target. Note that if for some reason this stays busy,
|
||||||
// it is actually due to the Previous dmi_read or dmi_write.
|
// it is actually due to the previous dmi_read or dmi_write.
|
||||||
for (i = 0; i < 256; i++) {
|
for (i = 0; i < 256; i++) {
|
||||||
status = dmi_scan(target, NULL, NULL, DMI_OP_READ, address, 0,
|
status = dmi_scan(target, NULL, NULL, DMI_OP_READ, address, 0,
|
||||||
false);
|
false);
|
||||||
|
@ -444,14 +443,14 @@ static uint64_t dmi_read(struct target *target, uint16_t address)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status != DMI_STATUS_SUCCESS) {
|
if (status != DMI_STATUS_SUCCESS) {
|
||||||
LOG_ERROR("Failed read from 0x%x; value=0x%" PRIx64 ", status=%d",
|
LOG_ERROR("Failed read from 0x%x; status=%d", address, status);
|
||||||
address, value, status);
|
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This second loop ensures that we got the read
|
// This second loop ensures that we got the read
|
||||||
// data back. Note that NOP can result in a 'busy' result as well, but
|
// data back. Note that NOP can result in a 'busy' result as well, but
|
||||||
// that would be noticed on the next DMI access we do.
|
// that would be noticed on the next DMI access we do.
|
||||||
|
uint64_t value;
|
||||||
for (i = 0; i < 256; i++) {
|
for (i = 0; i < 256; i++) {
|
||||||
status = dmi_scan(target, &address_in, &value, DMI_OP_NOP, address, 0,
|
status = dmi_scan(target, &address_in, &value, DMI_OP_NOP, address, 0,
|
||||||
false);
|
false);
|
||||||
|
|
Loading…
Reference in New Issue