Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
picsimlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
picsimlab
Commits
c3b1fb49
Commit
c3b1fb49
authored
Apr 06, 2024
by
lcgamboa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Fix gpboard configuration bits dump for PIC18F.
parent
e848690d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
src/boards/bridge_gpsim.cc
src/boards/bridge_gpsim.cc
+16
-3
tests/in_out/in_out_pic18gp.pzw
tests/in_out/in_out_pic18gp.pzw
+0
-0
No files found.
src/boards/bridge_gpsim.cc
View file @
c3b1fb49
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
void
simulation_cleanup
(
void
);
void
simulation_cleanup
(
void
);
static
pic_processor
*
gpic
=
NULL
;
static
pic_processor
*
gpic
=
NULL
;
static
IOPIN
*
iopins
[
100
];
static
IOPIN
*
iopins
[
100
];
int
bridge_gpsim_init
(
const
char
*
processor
,
const
char
*
fileName
,
float
freq
)
{
int
bridge_gpsim_init
(
const
char
*
processor
,
const
char
*
fileName
,
float
freq
)
{
...
@@ -144,6 +143,7 @@ int bridge_gpsim_dump_memory(const char* fname) {
...
@@ -144,6 +143,7 @@ int bridge_gpsim_dump_memory(const char* fname) {
unsigned
short
val
;
unsigned
short
val
;
unsigned
int
memsize
=
gpic
->
program_memory_size
()
*
2
;
unsigned
int
memsize
=
gpic
->
program_memory_size
()
*
2
;
unsigned
int
configsize
=
gpic
->
getConfigMemory
()
->
getnConfigWords
();
unsigned
int
configsize
=
gpic
->
getConfigMemory
()
->
getnConfigWords
();
unsigned
int
configaddr
=
0x2007
;
mem
=
(
unsigned
char
*
)
malloc
(
memsize
);
mem
=
(
unsigned
char
*
)
malloc
(
memsize
);
...
@@ -158,12 +158,14 @@ int bridge_gpsim_dump_memory(const char* fname) {
...
@@ -158,12 +158,14 @@ int bridge_gpsim_dump_memory(const char* fname) {
for
(
unsigned
int
i
=
0
;
i
<
configsize
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
configsize
;
i
++
)
{
if
(
gpic
->
getConfigMemory
()
->
getConfigWord
(
i
))
{
if
(
gpic
->
getConfigMemory
()
->
getConfigWord
(
i
))
{
config
[
i
]
=
gpic
->
getConfigMemory
()
->
getConfigWord
(
i
)
->
getVal
();
config
[
i
]
=
gpic
->
getConfigMemory
()
->
getConfigWord
(
i
)
->
getVal
();
// gpic->config_word_address() don´t work for PIC18F!
configaddr
=
gpic
->
getConfigMemory
()
->
getConfigWord
(
i
)
->
ConfigWordAdd
()
-
i
;
}
else
{
}
else
{
config
[
i
]
=
0
;
config
[
i
]
=
0
xFFFF
;
}
}
}
}
int
ret
=
write_hex
(
mem
,
memsize
,
config
,
configsize
,
gpic
->
config_word_address
()
,
fname
);
int
ret
=
write_hex
(
mem
,
memsize
,
config
,
configsize
,
configaddr
,
fname
);
free
(
mem
);
free
(
mem
);
free
(
config
);
free
(
config
);
...
@@ -229,6 +231,17 @@ static int write_hex(unsigned char* mem, unsigned int size, unsigned short* conf
...
@@ -229,6 +231,17 @@ static int write_hex(unsigned char* mem, unsigned int size, unsigned short* conf
// config
// config
nb
=
0
;
nb
=
0
;
sum
=
0
;
sum
=
0
;
if
(
configaddr
>
0xFFFF
)
{
fprintf
(
fout
,
":020000040030CA
\n
"
);
// FOR PIC18F
configaddr
=
0
;
for
(
unsigned
int
b
=
0
;
b
<
configsize
;
b
+=
2
)
{
config
[
b
/
2
]
=
((
config
[
b
+
1
]
&
0xFF
)
<<
8
)
|
(
config
[
b
]
&
0xFF
);
}
configsize
=
configsize
/
2
;
}
for
(
i
=
0
;
i
<
configsize
;
i
++
)
{
for
(
i
=
0
;
i
<
configsize
;
i
++
)
{
if
(
nb
==
0
)
{
if
(
nb
==
0
)
{
iaddr
=
(
configaddr
*
2
)
+
(
i
*
2
);
iaddr
=
(
configaddr
*
2
)
+
(
i
*
2
);
...
...
tests/in_out/in_out_pic18gp.pzw
View file @
c3b1fb49
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment