Robert Jordens | 25 Jul 07:45 2014
Picon

[M-Labs devel] [PATCH] migen.fhdl.structure: add Signal.like(other)

This is a convenience method. Signal(flen(other)) is used frequently but that
drops the signedness. Signal((other.nbits, other.signed)) would be correct but
is long.
---
 migen/fhdl/structure.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py
index 7ab4254..aa33888 100644
--- a/migen/fhdl/structure.py
+++ b/migen/fhdl/structure.py
 <at>  <at>  -274,6 +274,20  <at>  <at>  class Signal(Value):
 	def __repr__(self):
 		return "<Signal " + (self.backtrace[-1][0] or "anonymous") + " at " + hex(id(self)) + ">"

+	 <at> classmethod
+	def like(cls, other):
+		"""Create Signal based on another.
+
+		Parameters
+		----------
+		other : Value
+			Object to base this Signal on.
+
+		See `migen.fhdl.bitcontainer.value_bits_sign`() for details.
+		"""
+		from migen.fhdl.bitcontainer import value_bits_sign
+		return cls(value_bits_sign(other))
+
 class ClockSignal(Value):
(Continue reading)

Florent Kermarrec | 24 Jul 14:40 2014
Picon

[M-Labs devel] [PATCH] migen/sim/generic: use kwargs to pass parameters to icarus.Runner

Hi,

In my case I need to pass "extra_files" parameter to icarus.Runner but using kwargs seems better
than adding all parameters manually.

Florent
<div><div dir="ltr">Hi,<div><br></div>
<div>In my case I need to pass "extra_files" parameter to icarus.Runner but using kwargs seems better</div>
<div>than adding all parameters manually.</div>
<div><br></div>
<div>Florent</div>

</div></div>
Yann Sionneau | 20 Jul 22:07 2014
Picon

[M-Labs devel] update scripts.git

Hello everybody,

Can someone push the attached commit to scripts.git please?

This fixes the compilation of the toolchain on Debian Jessie (8) which is having the same issue as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746831 .

I just copied the fix available over there https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=patch;h=27b829ee701e29804216b3803fbaeb629be27491 for GDB and binutils.

Cheers!

--
Yann Sionneau
commit 21c9b99c046dd91dd4279c91bcb7e6d8c7005eb6
Author: Yann Sionneau <yann.sionneau <at> gmail.com>
Date:   Sun Jul 20 22:01:23 2014 +0200

    Fix toolchain compilation on Debian 8 Jessie

diff --git a/compile-lm32-rtems/Makefile b/compile-lm32-rtems/Makefile
index 6a7dbe9..2fc3685 100644
--- a/compile-lm32-rtems/Makefile
+++ b/compile-lm32-rtems/Makefile
 <at>  <at>  -95,7 +95,8  <at>  <at>  gcc-$(GCC_CORE_VERSION)/newlib: .unzip.ok
 	cd newlib-$(NEWLIB_VERSION) && \
 	 patch -p1 < ../$(RTEMS_PATCHES_DIR)/$(NEWLIB_PATCH)
 	cd gdb-$(GDB_VERSION) && \
-	 patch -p1 < ../$(RTEMS_PATCHES_DIR)/$(GDB_PATCH)
+	 patch -p1 < ../$(RTEMS_PATCHES_DIR)/$(GDB_PATCH) && patch -p1 < ../$(MM1_PATCHES_DIR)/gdb-fix-errors-in-bfd-header.patch
+	cd binutils-$(BINUTILS_VERSION) && patch -p1 < ../$(MM1_PATCHES_DIR)/binutils-fix-errors-in-bfd-header.patch
 	touch $ <at> 

 .unzip.ok: $(DL)/$(BINUTILS).ok $(DL)/$(GCC_CORE).ok $(DL)/$(NEWLIB).ok $(DL)/$(GDB).ok
$(DL)/$(MPFR).ok $(DL)/$(MPC).ok $(DL)/$(GMP).ok
diff --git
a/compile-lm32-rtems/milkymist-one-patches/binutils-fix-errors-in-bfd-header.patch b/compile-lm32-rtems/milkymist-one-patches/binutils-fix-errors-in-bfd-header.patch
new file mode 100644
index 0000000..e05b4eb
--- /dev/null
+++ b/compile-lm32-rtems/milkymist-one-patches/binutils-fix-errors-in-bfd-header.patch
 <at>  <at>  -0,0 +1,86  <at>  <at> 
+diff -Naur dl/binutils-2.23.90/bfd/bfd-in2.h binutils-2.23.90/bfd/bfd-in2.h
+--- dl/binutils-2.23.90/bfd/bfd-in2.h	2013-08-27 00:18:06.000000000 +0200
++++ binutils-2.23.90/bfd/bfd-in2.h	2014-07-20 19:53:16.982522896 +0200
+ <at>  <at>  -299,9 +299,6  <at>  <at> 
+ 
+ #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+ 
+-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)),
((ptr)->user_set_vma = TRUE), TRUE)
+-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
+-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+ /* Find the address one past the end of SEC.  */
+ #define bfd_get_section_limit(bfd, sec) \
+   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
+ <at>  <at>  -524,7 +521,6  <at>  <at> 
+ 
+ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+ 
+-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
+ 
+ extern bfd_boolean bfd_cache_close
+   (bfd *abfd);
+ <at>  <at>  -1583,6 +1579,28  <at>  <at> 
+   } map_head, map_tail;
+ } asection;
+ 
++static inline bfd_boolean
++bfd_set_section_vma(bfd *abfd ATTRIBUTE_UNUSED, asection *ptr, bfd_vma val)
++{
++	ptr->vma = ptr->lma = val;
++	ptr->user_set_vma = TRUE;
++	return TRUE;
++}
++
++static inline bfd_boolean
++bfd_set_section_userdata(bfd *abfd ATTRIBUTE_UNUSED, asection *ptr, void *val)
++{
++	ptr->userdata = val;
++	return TRUE;
++}
++
++static inline bfd_boolean
++bfd_set_section_alignment(bfd *abfd ATTRIBUTE_UNUSED, asection *ptr, unsigned int val)
++{
++	ptr->alignment_power = val;
++	return TRUE;
++}
++
+ /* Relax table contains information about instructions which can
+    be removed by relaxation -- replacing a long address with a
+    short address.  */
+ <at>  <at>  -6227,6 +6245,14  <at>  <at> 
+   unsigned int selective_search : 1;
+ };
+ 
++static inline bfd_boolean
++bfd_set_cacheable(bfd *abfd, bfd_boolean val)
++{
++	abfd->cacheable = val;
++	return TRUE;
++}
++
++
+ typedef enum bfd_error
+ {
+   bfd_error_no_error = 0,
+diff -Naur dl/binutils-2.23.90/bfd/bfd-in.h binutils-2.23.90/bfd/bfd-in.h
+--- dl/binutils-2.23.90/bfd/bfd-in.h	2013-08-21 09:28:37.000000000 +0200
++++ binutils-2.23.90/bfd/bfd-in.h	2014-07-20 19:46:31.576450617 +0200
+ <at>  <at>  -292,9 +292,6  <at>  <at> 
+ 
+ #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+ 
+-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)),
((ptr)->user_set_vma = TRUE), TRUE)
+-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
+-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+ /* Find the address one past the end of SEC.  */
+ #define bfd_get_section_limit(bfd, sec) \
+   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
+ <at>  <at>  -517,7 +514,6  <at>  <at> 
+ 
+ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+ 
+-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
+ 
+ extern bfd_boolean bfd_cache_close
+   (bfd *abfd);
diff --git a/compile-lm32-rtems/milkymist-one-patches/gdb-fix-errors-in-bfd-header.patch b/compile-lm32-rtems/milkymist-one-patches/gdb-fix-errors-in-bfd-header.patch
new file mode 100644
index 0000000..814aa23
--- /dev/null
+++ b/compile-lm32-rtems/milkymist-one-patches/gdb-fix-errors-in-bfd-header.patch
 <at>  <at>  -0,0 +1,88  <at>  <at> 
+diff -Naur dl/gdb-7.5.1/bfd/bfd-in2.h gdb-7.5.1/bfd/bfd-in2.h
+--- dl/gdb-7.5.1/bfd/bfd-in2.h	2012-07-13 17:47:23.000000000 +0200
++++ gdb-7.5.1/bfd/bfd-in2.h	2014-07-20 20:48:58.056706292 +0200
+ <at>  <at>  -301,9 +301,6  <at>  <at> 
+ 
+ #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+ 
+-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)),
((ptr)->user_set_vma = TRUE), TRUE)
+-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
+-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+ /* Find the address one past the end of SEC.  */
+ #define bfd_get_section_limit(bfd, sec) \
+   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
+ <at>  <at>  -526,8 +523,6  <at>  <at> 
+ 
+ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+ 
+-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
+-
+ extern bfd_boolean bfd_cache_close
+   (bfd *abfd);
+ /* NB: This declaration should match the autogenerated one in libbfd.h.  */
+ <at>  <at>  -1533,6 +1528,29  <at>  <at> 
+   } map_head, map_tail;
+ } asection;
+ 
++static inline bfd_boolean
++bfd_set_section_vma(bfd *abfd ATTRIBUTE_UNUSED, asection *ptr, bfd_vma val)
++{
++	ptr->vma = ptr->lma = val;
++	ptr->user_set_vma = TRUE;
++	return TRUE;
++}
++
++static inline bfd_boolean
++bfd_set_section_userdata(bfd *abfd ATTRIBUTE_UNUSED, asection *ptr, void *val)
++{
++	ptr->userdata = val;
++	return TRUE;
++}
++
++static inline bfd_boolean
++bfd_set_section_alignment(bfd *abfd ATTRIBUTE_UNUSED, asection *ptr, unsigned int val)
++{
++	ptr->alignment_power = val;
++	return TRUE;
++}
++
++
+ /* Relax table contains information about instructions which can
+    be removed by relaxation -- replacing a long address with a 
+    short address.  */
+ <at>  <at>  -5709,6 +5727,13  <at>  <at> 
+   unsigned int selective_search : 1;
+ };
+ 
++static inline bfd_boolean
++bfd_set_cacheable(bfd *abfd, bfd_boolean val)
++{
++	abfd->cacheable = val;
++	return TRUE;
++}
++
+ typedef enum bfd_error
+ {
+   bfd_error_no_error = 0,
+diff -Naur dl/gdb-7.5.1/bfd/bfd-in.h gdb-7.5.1/bfd/bfd-in.h
+--- dl/gdb-7.5.1/bfd/bfd-in.h	2012-06-04 16:35:20.000000000 +0200
++++ gdb-7.5.1/bfd/bfd-in.h	2014-07-20 20:48:04.153025696 +0200
+ <at>  <at>  -294,9 +294,6  <at>  <at> 
+ 
+ #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+ 
+-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)),
((ptr)->user_set_vma = TRUE), TRUE)
+-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
+-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+ /* Find the address one past the end of SEC.  */
+ #define bfd_get_section_limit(bfd, sec) \
+   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
+ <at>  <at>  -519,8 +516,6  <at>  <at> 
+ 
+ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+ 
+-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
+-
+ extern bfd_boolean bfd_cache_close
+   (bfd *abfd);
+ /* NB: This declaration should match the autogenerated one in libbfd.h.  */
commit 21c9b99c046dd91dd4279c91bcb7e6d8c7005eb6
Author: Yann Sionneau <yann.sionneau <at> gmail.com>
Date:   Sun Jul 20 22:01:23 2014 +0200

    Fix toolchain compilation on Debian 8 Jessie

diff --git a/compile-lm32-rtems/Makefile b/compile-lm32-rtems/Makefile
index 6a7dbe9..2fc3685 100644
--- a/compile-lm32-rtems/Makefile
+++ b/compile-lm32-rtems/Makefile
 <at>  <at>  -95,7 +95,8  <at>  <at>  gcc-$(GCC_CORE_VERSION)/newlib: .unzip.ok
 	cd newlib-$(NEWLIB_VERSION) && \
 	 patch -p1 < ../$(RTEMS_PATCHES_DIR)/$(NEWLIB_PATCH)
 	cd gdb-$(GDB_VERSION) && \
-	 patch -p1 < ../$(RTEMS_PATCHES_DIR)/$(GDB_PATCH)
+	 patch -p1 < ../$(RTEMS_PATCHES_DIR)/$(GDB_PATCH) && patch -p1 < ../$(MM1_PATCHES_DIR)/gdb-fix-errors-in-bfd-header.patch
+	cd binutils-$(BINUTILS_VERSION) && patch -p1 < ../$(MM1_PATCHES_DIR)/binutils-fix-errors-in-bfd-header.patch
 	touch $ <at> 

 .unzip.ok: $(DL)/$(BINUTILS).ok $(DL)/$(GCC_CORE).ok $(DL)/$(NEWLIB).ok $(DL)/$(GDB).ok
$(DL)/$(MPFR).ok $(DL)/$(MPC).ok $(DL)/$(GMP).ok
diff --git
a/compile-lm32-rtems/milkymist-one-patches/binutils-fix-errors-in-bfd-header.patch b/compile-lm32-rtems/milkymist-one-patches/binutils-fix-errors-in-bfd-header.patch
new file mode 100644
index 0000000..e05b4eb
--- /dev/null
+++ b/compile-lm32-rtems/milkymist-one-patches/binutils-fix-errors-in-bfd-header.patch
 <at>  <at>  -0,0 +1,86  <at>  <at> 
+diff -Naur dl/binutils-2.23.90/bfd/bfd-in2.h binutils-2.23.90/bfd/bfd-in2.h
+--- dl/binutils-2.23.90/bfd/bfd-in2.h	2013-08-27 00:18:06.000000000 +0200
++++ binutils-2.23.90/bfd/bfd-in2.h	2014-07-20 19:53:16.982522896 +0200
+ <at>  <at>  -299,9 +299,6  <at>  <at> 
+ 
+ #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+ 
+-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)),
((ptr)->user_set_vma = TRUE), TRUE)
+-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
+-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+ /* Find the address one past the end of SEC.  */
+ #define bfd_get_section_limit(bfd, sec) \
+   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
+ <at>  <at>  -524,7 +521,6  <at>  <at> 
+ 
+ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+ 
+-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
+ 
+ extern bfd_boolean bfd_cache_close
+   (bfd *abfd);
+ <at>  <at>  -1583,6 +1579,28  <at>  <at> 
+   } map_head, map_tail;
+ } asection;
+ 
++static inline bfd_boolean
++bfd_set_section_vma(bfd *abfd ATTRIBUTE_UNUSED, asection *ptr, bfd_vma val)
++{
++	ptr->vma = ptr->lma = val;
++	ptr->user_set_vma = TRUE;
++	return TRUE;
++}
++
++static inline bfd_boolean
++bfd_set_section_userdata(bfd *abfd ATTRIBUTE_UNUSED, asection *ptr, void *val)
++{
++	ptr->userdata = val;
++	return TRUE;
++}
++
++static inline bfd_boolean
++bfd_set_section_alignment(bfd *abfd ATTRIBUTE_UNUSED, asection *ptr, unsigned int val)
++{
++	ptr->alignment_power = val;
++	return TRUE;
++}
++
+ /* Relax table contains information about instructions which can
+    be removed by relaxation -- replacing a long address with a
+    short address.  */
+ <at>  <at>  -6227,6 +6245,14  <at>  <at> 
+   unsigned int selective_search : 1;
+ };
+ 
++static inline bfd_boolean
++bfd_set_cacheable(bfd *abfd, bfd_boolean val)
++{
++	abfd->cacheable = val;
++	return TRUE;
++}
++
++
+ typedef enum bfd_error
+ {
+   bfd_error_no_error = 0,
+diff -Naur dl/binutils-2.23.90/bfd/bfd-in.h binutils-2.23.90/bfd/bfd-in.h
+--- dl/binutils-2.23.90/bfd/bfd-in.h	2013-08-21 09:28:37.000000000 +0200
++++ binutils-2.23.90/bfd/bfd-in.h	2014-07-20 19:46:31.576450617 +0200
+ <at>  <at>  -292,9 +292,6  <at>  <at> 
+ 
+ #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+ 
+-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)),
((ptr)->user_set_vma = TRUE), TRUE)
+-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
+-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+ /* Find the address one past the end of SEC.  */
+ #define bfd_get_section_limit(bfd, sec) \
+   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
+ <at>  <at>  -517,7 +514,6  <at>  <at> 
+ 
+ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+ 
+-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
+ 
+ extern bfd_boolean bfd_cache_close
+   (bfd *abfd);
diff --git a/compile-lm32-rtems/milkymist-one-patches/gdb-fix-errors-in-bfd-header.patch b/compile-lm32-rtems/milkymist-one-patches/gdb-fix-errors-in-bfd-header.patch
new file mode 100644
index 0000000..814aa23
--- /dev/null
+++ b/compile-lm32-rtems/milkymist-one-patches/gdb-fix-errors-in-bfd-header.patch
 <at>  <at>  -0,0 +1,88  <at>  <at> 
+diff -Naur dl/gdb-7.5.1/bfd/bfd-in2.h gdb-7.5.1/bfd/bfd-in2.h
+--- dl/gdb-7.5.1/bfd/bfd-in2.h	2012-07-13 17:47:23.000000000 +0200
++++ gdb-7.5.1/bfd/bfd-in2.h	2014-07-20 20:48:58.056706292 +0200
+ <at>  <at>  -301,9 +301,6  <at>  <at> 
+ 
+ #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+ 
+-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)),
((ptr)->user_set_vma = TRUE), TRUE)
+-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
+-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+ /* Find the address one past the end of SEC.  */
+ #define bfd_get_section_limit(bfd, sec) \
+   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
+ <at>  <at>  -526,8 +523,6  <at>  <at> 
+ 
+ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+ 
+-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
+-
+ extern bfd_boolean bfd_cache_close
+   (bfd *abfd);
+ /* NB: This declaration should match the autogenerated one in libbfd.h.  */
+ <at>  <at>  -1533,6 +1528,29  <at>  <at> 
+   } map_head, map_tail;
+ } asection;
+ 
++static inline bfd_boolean
++bfd_set_section_vma(bfd *abfd ATTRIBUTE_UNUSED, asection *ptr, bfd_vma val)
++{
++	ptr->vma = ptr->lma = val;
++	ptr->user_set_vma = TRUE;
++	return TRUE;
++}
++
++static inline bfd_boolean
++bfd_set_section_userdata(bfd *abfd ATTRIBUTE_UNUSED, asection *ptr, void *val)
++{
++	ptr->userdata = val;
++	return TRUE;
++}
++
++static inline bfd_boolean
++bfd_set_section_alignment(bfd *abfd ATTRIBUTE_UNUSED, asection *ptr, unsigned int val)
++{
++	ptr->alignment_power = val;
++	return TRUE;
++}
++
++
+ /* Relax table contains information about instructions which can
+    be removed by relaxation -- replacing a long address with a 
+    short address.  */
+ <at>  <at>  -5709,6 +5727,13  <at>  <at> 
+   unsigned int selective_search : 1;
+ };
+ 
++static inline bfd_boolean
++bfd_set_cacheable(bfd *abfd, bfd_boolean val)
++{
++	abfd->cacheable = val;
++	return TRUE;
++}
++
+ typedef enum bfd_error
+ {
+   bfd_error_no_error = 0,
+diff -Naur dl/gdb-7.5.1/bfd/bfd-in.h gdb-7.5.1/bfd/bfd-in.h
+--- dl/gdb-7.5.1/bfd/bfd-in.h	2012-06-04 16:35:20.000000000 +0200
++++ gdb-7.5.1/bfd/bfd-in.h	2014-07-20 20:48:04.153025696 +0200
+ <at>  <at>  -294,9 +294,6  <at>  <at> 
+ 
+ #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+ 
+-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)),
((ptr)->user_set_vma = TRUE), TRUE)
+-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
+-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+ /* Find the address one past the end of SEC.  */
+ #define bfd_get_section_limit(bfd, sec) \
+   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
+ <at>  <at>  -519,8 +516,6  <at>  <at> 
+ 
+ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+ 
+-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
+-
+ extern bfd_boolean bfd_cache_close
+   (bfd *abfd);
+ /* NB: This declaration should match the autogenerated one in libbfd.h.  */
Robert Jordens | 19 Jul 07:19 2014
Picon

[M-Labs devel] [PATCH 2/2] flow.plumbing: spelling

---
 migen/flow/plumbing.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migen/flow/plumbing.py b/migen/flow/plumbing.py
index cb8abf4..2e2ea98 100644
--- a/migen/flow/plumbing.py
+++ b/migen/flow/plumbing.py
 <at>  <at>  -65,7 +65,7  <at>  <at>  class Multiplexer(Module):
 		
 		###

-		case = {}
+		cases = {}
 		for i, sink in enumerate(sinks):
 			cases[i] = Record.connect(sink, self.source)
 		self.comb += Case(self.sel, cases)
--

-- 
1.9.1

Robert Jordens | 19 Jul 07:18 2014
Picon

[M-Labs devel] [PATCH 1/2] flow.plumbing: make argument order consistent

---
 migen/flow/plumbing.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migen/flow/plumbing.py b/migen/flow/plumbing.py
index 5c48af3..cb8abf4 100644
--- a/migen/flow/plumbing.py
+++ b/migen/flow/plumbing.py
 <at>  <at>  -53,7 +53,7  <at>  <at>  class Splitter(Module):
 			self.comb += s.stb.eq(self.sink.stb & ~already_acked[n])

 class Multiplexer(Module):
-	def __init__(self, n, layout):
+	def __init__(self, layout, n):
 		self.source = Source(layout)
 		sinks = []
 		for i in range(n):
--

-- 
1.9.1

Iñigo Muguruza | 16 Jul 14:18 2014
Picon

[M-Labs devel] Fwd: gdb stub implementation in Misoc



---------- Forwarded message ----------
From: Iñigo Muguruza <inigo.muguruza89-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: 2014-07-16 13:17 GMT+01:00
Subject: Re: [M-Labs devel] gdb stub implementation in Misoc
To: Yann Sionneau <yann.sionneau-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


Hi Yann,

thanks for your answers.

We were hoping to compile a Hello world program and link it with the gdb stub, so that we could use gdb and the serial port to debug the program. Why can't it be loaded in sdram instead of the rom?  What do we need to change so that this happens? Ony the flterm seems to block while loading the program.

Regards,

Iñigo








2014-07-16 11:45 GMT+01:00 Yann Sionneau <yann.sionneau-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:

In Milkymist legacy SoC the gdbstub is not loaded in DDR SDRAM, it
seems that's what you are doing by loading it via serialboot.

In fact, in Milkymist, the gdbstub is loaded in on-chip ROM (
https://github.com/m-labs/milkymist/blob/master/cores/monitor/rtl/monitor.v
).
So the gdb stub is compiled using a different linker script
(https://github.com/m-labs/milkymist/blob/master/software/gdbstub/linker.ld)
because the ROM is mapped at a different address than DDR SDRAM or
flash.

Could you explain what exactly you are trying to do ?

What were you expecting from the main.c you posted?

Btw, lm32 has an (optional) instruction cache, on legacy soc both
instruction and data caches are enabled. On Misoc it seems both caches
are enabled as well, cf
https://github.com/m-labs/misoc/blob/master/verilog/lm32/lm32_config.v

Regards,

Yann



2014-07-16 11:56 GMT+02:00 Iñigo Muguruza <inigo.muguruza89-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
> Hi everyone,
>
> I'm trying to implement gdb stub in Misoc. I'm using the gdbstub.c and
> crt0.S that are located within the project of milkymist. I have compiled and
> linked them using the blinkie's project main.c, makefile  and misoc linker
> (linker-sdram.ld). I have managed to create the .bin, but when I upload it,
> using flterm, it freezes, like this:
>
> BIOS> serialboot
> Booting from serial...
> sL5DdSMmkekro
> [FLTERM] Received firmware download request from the device.
> [FLTERM] Uploading kernel (13888 bytes)...
> 12%
>
> Any idea which could be the reason??
>
> I know that the main.c has a lot mistakes, but firstly I'm trying to upload
> the .bin . I have attached the makefile, main.c and the .bin.
>
> Thanks in advance,
>
>
>
> _______________________________________________
> M-Labs devel mailing list
> Devel <at> lists.m-labs.hk
> https://ssl.serverraum.org/lists/listinfo/devel
>



--
Yann Sionneau


<div><div dir="ltr">
<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: I&ntilde;igo Muguruza <span dir="ltr">&lt;<a href="mailto:inigo.muguruza89@...">inigo.muguruza89@...</a>&gt;</span><br>
Date: 2014-07-16 13:17 GMT+01:00<br>Subject: Re: [M-Labs devel] gdb stub implementation in Misoc<br>To: Yann Sionneau &lt;<a href="mailto:yann.sionneau@...">yann.sionneau@...</a>&gt;<br><br><br><div dir="ltr">
<div>
<div>
<div>Hi Yann,<br><br>
</div>thanks for your answers. <br><br>
</div>We were hoping to compile a Hello world program and link it with the gdb stub, so that we could use gdb and the serial port to debug the program. Why can't it be loaded in sdram instead of the rom?&nbsp; What do we need to change so that this happens? Ony the flterm seems to block while loading the program.<br><br>
</div>
<div>Regards,<br><br>
</div>
<div>I&ntilde;igo <br>
</div>
<div><br></div>
<br><div>
<br><br><br><br>
</div>
</div>
<div class="gmail_extra">
<br><br><div class="gmail_quote">2014-07-16 11:45 GMT+01:00 Yann Sionneau <span dir="ltr">&lt;<a href="mailto:yann.sionneau@..." target="_blank">yann.sionneau@...</a>&gt;</span>:<div>
<div class="h5">
<br><blockquote class="gmail_quote">In Milkymist legacy SoC the gdbstub is not loaded in DDR SDRAM, it<br>
seems that's what you are doing by loading it via serialboot.<br><br>
In fact, in Milkymist, the gdbstub is loaded in on-chip ROM (<br><a href="https://github.com/m-labs/milkymist/blob/master/cores/monitor/rtl/monitor.v" target="_blank">https://github.com/m-labs/milkymist/blob/master/cores/monitor/rtl/monitor.v</a><br>
).<br>
So the gdb stub is compiled using a different linker script<br>
(<a href="https://github.com/m-labs/milkymist/blob/master/software/gdbstub/linker.ld" target="_blank">https://github.com/m-labs/milkymist/blob/master/software/gdbstub/linker.ld</a>)<br>
because the ROM is mapped at a different address than DDR SDRAM or<br>
flash.<br><br>
Could you explain what exactly you are trying to do ?<br><br>
What were you expecting from the main.c you posted?<br><br>
Btw, lm32 has an (optional) instruction cache, on legacy soc both<br>
instruction and data caches are enabled. On Misoc it seems both caches<br>
are enabled as well, cf<br><a href="https://github.com/m-labs/misoc/blob/master/verilog/lm32/lm32_config.v" target="_blank">https://github.com/m-labs/misoc/blob/master/verilog/lm32/lm32_config.v</a><br><br>
Regards,<br><br>
Yann<br><br><br><br>
2014-07-16 11:56 GMT+02:00 I&ntilde;igo Muguruza &lt;<a href="mailto:inigo.muguruza89@..." target="_blank">inigo.muguruza89@...</a>&gt;:<br><div><div>&gt; Hi everyone,<br>
&gt;<br>
&gt; I'm trying to implement gdb stub in Misoc. I'm using the gdbstub.c and<br>
&gt; crt0.S that are located within the project of milkymist. I have compiled and<br>
&gt; linked them using the blinkie's project main.c, makefile &nbsp;and misoc linker<br>
&gt; (linker-sdram.ld). I have managed to create the .bin, but when I upload it,<br>
&gt; using flterm, it freezes, like this:<br>
&gt;<br>
&gt; BIOS&gt; serialboot<br>
&gt; Booting from serial...<br>
&gt; sL5DdSMmkekro<br>
&gt; [FLTERM] Received firmware download request from the device.<br>
&gt; [FLTERM] Uploading kernel (13888 bytes)...<br>
&gt; 12%<br>
&gt;<br>
&gt; Any idea which could be the reason??<br>
&gt;<br>
&gt; I know that the main.c has a lot mistakes, but firstly I'm trying to upload<br>
&gt; the .bin . I have attached the makefile, main.c and the .bin.<br>
&gt;<br>
&gt; Thanks in advance,<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; M-Labs devel mailing list<br>
&gt; <a href="mailto:Devel@..." target="_blank">Devel <at> lists.m-labs.hk</a><br>
&gt; <a href="https://ssl.serverraum.org/lists/listinfo/devel" target="_blank">https://ssl.serverraum.org/lists/listinfo/devel</a><br>
&gt;<br><span><br><br><br>
--<br>
Yann Sionneau<br></span>
</blockquote>
</div>
</div>
</div>
<br>
</div>
</div>
<br>
</div></div>
Iñigo Muguruza | 16 Jul 11:56 2014
Picon

[M-Labs devel] gdb stub implementation in Misoc

Hi everyone,

I'm trying to implement gdb stub in Misoc. I'm using the gdbstub.c and crt0.S that are located within the project of milkymist. I have compiled and linked them using the blinkie's project main.c, makefile  and misoc linker (linker-sdram.ld). I have managed to create the .bin, but when I upload it, using flterm, it freezes, like this:

BIOS> serialboot
Booting from serial...
sL5DdSMmkekro
[FLTERM] Received firmware download request from the device.
[FLTERM] Uploading kernel (13888 bytes)...
12%

Any idea which could be the reason??

I know that the main.c has a lot mistakes, but firstly I'm trying to upload the .bin . I have attached the makefile, main.c and the .bin.

Thanks in advance,


Attachment (blinkie.bin): application/octet-stream, 18 KiB
Attachment (main.c): text/x-csrc, 2504 bytes
Attachment (Makefile): application/octet-stream, 1365 bytes
<div><div dir="ltr">
<div>
<div>
<div>Hi everyone,<br><br>
</div>I'm trying to implement gdb stub in Misoc. I'm using the gdbstub.c and crt0.S that are located within the project of milkymist. I have compiled and linked them using the blinkie's project main.c, makefile&nbsp; and misoc linker (linker-sdram.ld). I have managed to create the .bin, but when I upload it, using flterm, it freezes, like this:<br><br>BIOS&gt; serialboot<br>Booting from serial...<br>sL5DdSMmkekro<br>[FLTERM] Received firmware download request from the device.<br>[FLTERM] Uploading kernel (13888 bytes)...<br>12%<br><br>
</div>
<div>Any idea which could be the reason??<br>
</div>
<div><br></div>I know that the main.c has a lot mistakes, but firstly I'm trying to upload the .bin . I have attached the makefile, main.c and the .bin.<br><br>
</div>Thanks in advance,<br><br><br>
</div></div>
Fabien Marteau | 9 Jul 16:28 2014

[M-Labs devel] adding apf51 platform from armadeus systems

Hi all,

Please find in attachment the apf51.py platform description file for the
APF51 board designed by Armadeus Systems:
http://www.armadeus.com/english/products-processor_boards-apf51.html

This board is designed with an i.MX51 processor and a Spartan6 FPGA.

I managed to blink a led with the dev board apf51dev and this migen program:

#!/usr/local/bin/python3.4
# -*- coding: utf-8 -*-

from migen.fhdl.std import *
from mibuild.generic_platform import Pins, IOStandard
from mibuild.platforms import apf51

ios = [
    ("user_led", 0, Pins("J2:15"), IOStandard("LVCMOS33"))
]

plat = apf51.Platform()
plat.add_extension(ios)
led = plat.request("user_led", 0)  # led pin on apf51dev
m = Module()
counter = Signal(26)
m.comb += led.eq(counter[25])
m.sync += counter.eq(counter + 1)
plat.build_cmdline(m)

This board is design on the same model than APF27.

Regards,
-- 
Fabien Marteau
FPGA expert & Hardware Engineer
Tel: +33 (0)9 72 29 41 44
Fax: +33 (0)9 72 28 79 26
ARMadeus Systems - A new vision of the embedded world
http://www.armadeus.com

For any confidential message, please encrypt your mail with my
public key :
http://www.martoni.fr/documents/Fabien%20Marteau%20fabien.marteau-d2DlULPkwbNWk0Htik3J/w <at> public.gmane.org%20%280x1A1DA7D8%29%20pub.asc

Hi all,

Please find in attachment the apf51.py platform description file for the
APF51 board designed by Armadeus Systems:
http://www.armadeus.com/english/products-processor_boards-apf51.html

This board is designed with an i.MX51 processor and a Spartan6 FPGA.

I managed to blink a led with the dev board apf51dev and this migen program:

#!/usr/local/bin/python3.4
# -*- coding: utf-8 -*-

from migen.fhdl.std import *
from mibuild.generic_platform import Pins, IOStandard
from mibuild.platforms import apf51

ios = [
    ("user_led", 0, Pins("J2:15"), IOStandard("LVCMOS33"))
]

plat = apf51.Platform()
plat.add_extension(ios)
led = plat.request("user_led", 0)  # led pin on apf51dev
m = Module()
counter = Signal(26)
m.comb += led.eq(counter[25])
m.sync += counter.eq(counter + 1)
plat.build_cmdline(m)

This board is design on the same model than APF27.

Regards,
--

-- 
Fabien Marteau
FPGA expert & Hardware Engineer
Tel: +33 (0)9 72 29 41 44
Fax: +33 (0)9 72 28 79 26
ARMadeus Systems - A new vision of the embedded world
http://www.armadeus.com

For any confidential message, please encrypt your mail with my
public key :
http://www.martoni.fr/documents/Fabien%20Marteau%20fabien.marteau-d2DlULPkwbNWk0Htik3J/w <at> public.gmane.org%20%280x1A1DA7D8%29%20pub.asc

Fabien Marteau | 9 Jul 12:16 2014

[M-Labs devel] adding apf27 platform from armadeus systems

Hi all,

Please find in attachment the apf27.py platform description file for the
APF27 board designed by Armadeus Systems:
http://www.armadeus.com/english/products-processor_boards-apf27.html

I managed to blink led with the following migen program:

#!/usr/local/bin/python3.4
# -*- coding: utf-8 -*-

from migen.fhdl.std import *
from mibuild.generic_platform import Pins, IOStandard
from mibuild.platforms import apf27

ios = [
    ("user_led", 0, Pins("J2:22"), IOStandard("LVCMOS33"))
]

plat = apf27.Platform()
plat.add_extension(ios)
led = plat.request("user_led", 0)  # led pin on apf27dev
m = Module()
counter = Signal(26)
m.comb += led.eq(counter[25])
m.sync += counter.eq(counter + 1)
plat.build_cmdline(m)

This board is always plugged on other board like the apf27dev
developpment board :
http://www.armadeus.com/english/products-development_boards-apf27_dev.html

I think I will have to write a platform file (apf27dev.py) that inherit
from apf27.py to use it.
I will do that once apf27.py be commited on migen.

Regards,
-- 
Fabien Marteau
FPGA expert & Hardware Engineer
Tel: +33 (0)9 72 29 41 44
Fax: +33 (0)9 72 28 79 26
ARMadeus Systems - A new vision of the embedded world
http://www.armadeus.com

For any confidential message, please encrypt your mail with my
public key :
http://www.martoni.fr/documents/Fabien%20Marteau%20fabien.marteau-d2DlULPkwbNWk0Htik3J/w <at> public.gmane.org%20%280x1A1DA7D8%29%20pub.asc

Hi all,

Please find in attachment the apf27.py platform description file for the
APF27 board designed by Armadeus Systems:
http://www.armadeus.com/english/products-processor_boards-apf27.html

I managed to blink led with the following migen program:

#!/usr/local/bin/python3.4
# -*- coding: utf-8 -*-

from migen.fhdl.std import *
from mibuild.generic_platform import Pins, IOStandard
from mibuild.platforms import apf27

ios = [
    ("user_led", 0, Pins("J2:22"), IOStandard("LVCMOS33"))
]

plat = apf27.Platform()
plat.add_extension(ios)
led = plat.request("user_led", 0)  # led pin on apf27dev
m = Module()
counter = Signal(26)
m.comb += led.eq(counter[25])
m.sync += counter.eq(counter + 1)
plat.build_cmdline(m)

This board is always plugged on other board like the apf27dev
developpment board :
http://www.armadeus.com/english/products-development_boards-apf27_dev.html

I think I will have to write a platform file (apf27dev.py) that inherit
from apf27.py to use it.
I will do that once apf27.py be commited on migen.

Regards,
--

-- 
Fabien Marteau
FPGA expert & Hardware Engineer
Tel: +33 (0)9 72 29 41 44
Fax: +33 (0)9 72 28 79 26
ARMadeus Systems - A new vision of the embedded world
http://www.armadeus.com

For any confidential message, please encrypt your mail with my
public key :
http://www.martoni.fr/documents/Fabien%20Marteau%20fabien.marteau-d2DlULPkwbNWk0Htik3J/w <at> public.gmane.org%20%280x1A1DA7D8%29%20pub.asc

Fabien Marteau | 9 Jul 09:59 2014

[M-Labs devel] Adding ability to use void pins (none fpga pin) for connectors

Hi all,

Somes platform-connectors have more than FPGA pins. We can have GND, VCC
or others processor signals on the same connector. The problem is that
break numbering if we only describe fpga pin on connectors like on
papillio_pro platform :
https://github.com/m-labs/migen/blob/master/mibuild/platforms/papilio_pro.py#L44

For this reasons, I suggest to use "None" string for describing
pins-connectors that are not related to FPGA I/O.

We can then describe connectors like that :

_connectors = [
("J1", "None P48 P51 None P58 P61 P66 None None None"),
]

I added a patch in attachment to manage "None" string in
ConnectorManager init class.

Regards,
-- 
Fabien Marteau
FPGA expert & Hardware Engineer
Tel: +33 (0)9 72 29 41 44
Fax: +33 (0)9 72 28 79 26
ARMadeus Systems - A new vision of the embedded world
http://www.armadeus.com

For any confidential message, please encrypt your mail with my
public key :
http://www.martoni.fr/documents/Fabien%20Marteau%20fabien.marteau-d2DlULPkwbNWk0Htik3J/w <at> public.gmane.org%20%280x1A1DA7D8%29%20pub.asc

Hi all,

Somes platform-connectors have more than FPGA pins. We can have GND, VCC
or others processor signals on the same connector. The problem is that
break numbering if we only describe fpga pin on connectors like on
papillio_pro platform :
https://github.com/m-labs/migen/blob/master/mibuild/platforms/papilio_pro.py#L44

For this reasons, I suggest to use "None" string for describing
pins-connectors that are not related to FPGA I/O.

We can then describe connectors like that :

_connectors = [
("J1", "None P48 P51 None P58 P61 P66 None None None"),
]

I added a patch in attachment to manage "None" string in
ConnectorManager init class.

Regards,
--

-- 
Fabien Marteau
FPGA expert & Hardware Engineer
Tel: +33 (0)9 72 29 41 44
Fax: +33 (0)9 72 28 79 26
ARMadeus Systems - A new vision of the embedded world
http://www.armadeus.com

For any confidential message, please encrypt your mail with my
public key :
http://www.martoni.fr/documents/Fabien%20Marteau%20fabien.marteau-d2DlULPkwbNWk0Htik3J/w <at> public.gmane.org%20%280x1A1DA7D8%29%20pub.asc

Iñigo Muguruza | 4 Jul 13:20 2014
Picon

[M-Labs devel] Misoc de0 nano

Hi,

I'm trying to use SimpleSoc with Miscope that is included in misoc-de0nano/de0nano.py. In order to do so, I have changed the next line:

#default_subtarget = SimpleSoC
default_subtarget = SimpleSoCMiscope

When I run the make script, doing this:
./make.py -X ../misoc-de0nano -t de0nano build-bitstream load-bitstream

I receive the next error:

Traceback (most recent call last):
  File "./make.py", line 78, in <module>
    target_module = _misoc_import("targets", external_target, args.target)
  File "./make.py", line 63, in _misoc_import
    return loader.load_module()
  File "<frozen importlib._bootstrap>", line 539, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1614, in load_module
  File "<frozen importlib._bootstrap>", line 596, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 1220, in load
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "../misoc-de0nano/targets/de0nano.py", line 25, in <module>
    from miscope import trigger, miio, mila, uart2wishbone
ImportError: No module named 'miscope'

It can't locate the libraries... How can I fix it??

thanks in advance!

Iñigo Muguruza
<div><div dir="ltr">
<div>
<div>
<div>
<div>
<div>Hi,<br><br>
</div>I'm trying to use SimpleSoc with Miscope that is included in misoc-de0nano/de0nano.py. In order to do so, I have changed the next line:<br><br>#default_subtarget = SimpleSoC<br>
default_subtarget = SimpleSoCMiscope<br><br>
</div>When I run the make script, doing this:<br>./make.py -X ../misoc-de0nano -t de0nano build-bitstream load-bitstream<br><br>
</div>I receive the next error:<br><br>Traceback (most recent call last):<br>
&nbsp; File "./make.py", line 78, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp; target_module = _misoc_import("targets", external_target, args.target)<br>&nbsp; File "./make.py", line 63, in _misoc_import<br>&nbsp;&nbsp;&nbsp; return loader.load_module()<br>
&nbsp; File "&lt;frozen importlib._bootstrap&gt;", line 539, in _check_name_wrapper<br>&nbsp; File "&lt;frozen importlib._bootstrap&gt;", line 1614, in load_module<br>&nbsp; File "&lt;frozen importlib._bootstrap&gt;", line 596, in _load_module_shim<br>
&nbsp; File "&lt;frozen importlib._bootstrap&gt;", line 1220, in load<br>&nbsp; File "&lt;frozen importlib._bootstrap&gt;", line 1200, in _load_unlocked<br>&nbsp; File "&lt;frozen importlib._bootstrap&gt;", line 1129, in _exec<br>
&nbsp; File "&lt;frozen importlib._bootstrap&gt;", line 1471, in exec_module<br>&nbsp; File "&lt;frozen importlib._bootstrap&gt;", line 321, in _call_with_frames_removed<br>&nbsp; File "../misoc-de0nano/targets/de0nano.py", line 25, in &lt;module&gt;<br>
&nbsp;&nbsp;&nbsp; from miscope import trigger, miio, mila, uart2wishbone<br>ImportError: No module named 'miscope'<br><br>
</div>It can't locate the libraries... How can I fix it??<br><br>
</div>thanks in advance!<br><br>I&ntilde;igo Muguruza<br>
</div></div>

Gmane