Граф коммитов

1258 коммитов

Автор SHA1 Сообщение Дата
Dmitri Goutnik
71a380ce8c Add initial FreeBSD support 2019-12-29 10:48:28 +01:00
Ayke van Laethem
3b2a4b64c5 main: kill tests if they run too long
Sometimes, tests suddenly hang somewhere (in particular in emulators
where crashes often lead to hangs). Setting a limit has two advantages:

  1. Quickly killing test processes that are frozen (as opposed to
     waiting for the default 10min go test timeout).
  2. The output becomes visible, hopefully giving a clue what went
     wrong.
2019-12-28 21:10:13 +01:00
Ayke van Laethem
184827e4d8 riscv: support sleeping in QEMU
QEMU doesn't support the RTC peripheral yet so work around it for now.

This makes the following command work:

    tinygo run -target=hifive1-qemu ./testdata/coroutines.go
2019-12-26 09:57:58 +01:00
Ayke van Laethem
14474e7099 compiler: fix assertion on empty interface
This fixes issue #453.
2019-12-26 09:20:22 +01:00
Ron Evans
3656ac2fc9 main: increment version to 0.12-dev
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-12-24 19:48:38 +01:00
Ayke van Laethem
08f01ba3ff riscv: improve startup assembly
Now that we've switched to LLVM 9, we don't need a workaround anymore
for the 'la' pseudo-instruction.
2019-12-24 19:00:22 +01:00
Ayke van Laethem
699312f477 ci: remove symlink creation
These symlinks are now unnecessary because Clang (and previously lld)
have been integrated into TinyGo.
2019-12-24 08:59:33 +01:00
Ayke van Laethem
9644edcd5a builder: update Clang header location
We have long since moved towards a different location for these headers
in the git checkout, so update where getClangHeaderPath looks for these
headers.

Also add an extra check to make sure a path has been detected.
2019-12-24 08:59:33 +01:00
Ayke van Laethem
46325910c5 ci: increase Azure Pipelines timeout to 4 hours
3 hours is too close to the edge. Extend to 4 hours to make sure a build
including LLVM build will finish before the deadline.
2019-12-24 08:49:04 +01:00
Ayke van Laethem
923c2e7ada main: version 0.11.0 2019-12-23 16:37:59 +01:00
Ron Evans
18e446561d flash: use more precise searches for correct volume/port with default Windows matching
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-12-23 16:09:58 +01:00
Ron Evans
447537aebe flash: use win32 wmi to try to find UF2 and COM ports
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-12-23 16:09:58 +01:00
Ayke van Laethem
74e32acf33 compiler: improve error locations in goroutine lowering 2019-12-23 08:33:04 +01:00
Ayke van Laethem
072f8c354e interp: add runtime fallback for mapassign operations
Some mapassign operations cannot (yet) be done by the interp package.
Implement a fallback mechanism so that these operations can still be
performed at runtime.
2019-12-23 08:15:09 +01:00
Daniel Esteban
0587934a44 added missing pinetime devkit to list of suppoerted boards/targets 2019-12-22 21:23:07 +01:00
Daniel Esteban
c2481b10f4 Added Adafruit's pybadge target (#795)
* machine/pybadge: add support for Adafruit PyBadge board
2019-12-22 19:37:16 +01:00
Ayke van Laethem
d41f01f003 main: avoid leaving files open
Eventually, open files should be closed when the GC runs and the
finalizer is called. However we shouldn't rely on that.

Using `ioutil.ReadFile` as it's a simpler pattern anyway.
2019-12-21 23:12:13 +01:00
Ayke van Laethem
5a70c88483 transform: make reflection sidetables constant globals
These globals are (and must be!) never modified by the reflect package.
By marking them as constant, they will be put in read-only memory. This
reduces RAM consumption on microcontrollers.
2019-12-21 22:59:23 +01:00
Ayke van Laethem
5510dec846 compiler: add location information to the IR checker 2019-12-21 20:49:51 +01:00
Ayke van Laethem
dffb9fbfa7 tools: use byte padding to skip unused register ranges
This simplifies the code. The fields are blank anyway so there is no way
to access them anyway (volatile or not).
Also do some other related simplifications of the code that result from
this change.
2019-12-21 19:59:41 +01:00
Jaden Weiss
525ded3d90 run tests partially in parallel 2019-12-21 12:22:59 +01:00
Ayke van Laethem
ec2658ca79 interp: remove accidental debug print
Accidentally left in the source in
https://github.com/tinygo-org/tinygo/pull/787.
2019-12-20 14:47:20 +01:00
Ayke van Laethem
2004555fe2 interp: check whether the map update key/value are constant
This is a limitation in the PutString/PutBinary calls, make sure that
they won't get non-constant values as a safety measure.
2019-12-20 01:43:12 +01:00
Ayke van Laethem
9aeb8d9e06 interp: support llvm.lifetime.* calls
This fixes a bug found when updating a map with string keys.
Originally reported here:
https://github.com/hybridgroup/gdg-2019/issues/6
2019-12-20 01:43:12 +01:00
Ron Evans
34ee3883d6 flash: search for default serial port on both macOS and Linux
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-12-17 02:15:06 +01:00
Ayke van Laethem
768c652468 machine: rename CPU_FREQUENCY -> CPUFrequency()
These all-caps constants aren't in the Go style, so rename it to
CPUFrequency (which is more aligned with Go style). Additionally, make
it a function so that it is possible to add support for changing the
frequency in the future.

Tested by running `make smoketest`. None of the outputs did change.
2019-12-16 20:34:39 +01:00
Daniel Esteban
2778377ac9 Nano33 IoT: default SPI should be D13/D11/D12 instead of A2/A3/A6 (#781)
* Nano33 IoT: default SPI should be D13/D11/D12 instead of A2/A3/A6
2019-12-15 15:21:33 +01:00
Ayke van Laethem
cf32607306 tools: rewrite gen-device-svd in Go
This should make it more maintainable. Another big advantage that
generation time (including gofmt) is now 3 times faster. No real attempt
at refactoring has been made, that will need to be done at a later time.
2019-12-14 22:27:45 +01:00
Ayke van Laethem
ad022ef23d riscv: add support for compiler-rt
This gets all the tests to compile and many of them to pass. There are
some issues left, but those are probably unrelated to compiler-rt.
2019-12-14 12:48:21 +01:00
Ayke van Laethem
c97b7221bd machine: support arduino-nano33 on play.tinygo.org 2019-12-11 21:49:19 +01:00
Ayke van Laethem
8d32a7c3a3 builder: use builtin Clang when building statically
This will be a huge help for people installing TinyGo that don't have
LLVM/Clang 9 already installed and in the $PATH variable.
2019-12-11 20:17:35 +01:00
Ayke van Laethem
49eb414530 machine: add Tx method to simulated SPI bus
This allows display drivers like st7789 to be used on the TinyGo
Playground.
2019-12-08 19:08:37 +01:00
Ayke van Laethem
39d21e21f1 targets: simulate Circuit Playground Express in play.tinygo.org
This requires a number of changes to atsamd21 code. It's not a very
clean separation, but I couldn't come up with a better one.
2019-12-08 13:11:39 +01:00
Ayke van Laethem
fa8a93b4e7 cgo: don't run tests in parallel
Since LLVM 9, CGo sometimes randomly breaks with weird error messages on
Windows. I'm not sure why this is the case, but it might be related to
concurrency.

Disable concurrency for now, and hope that will make the errors go away.
2019-12-08 12:35:43 +01:00
Ayke van Laethem
8f9419a35d targets: add hifive1-qemu for testing RISC-V bare metal in QEMU
Most tests don't pass yet, so can't add this test to the standard tests,
yet.
2019-12-07 16:47:40 +01:00
Ayke van Laethem
7bdd4a1186 main: add support for QEMU in the gdb subcommand
This allows debugging QEMU-only targets with GDB, which can be super
useful.
2019-12-07 16:47:40 +01:00
Ayke van Laethem
0105f815c6 targets: rename qemu target to cortex-m-qemu
The target is intended to emulate the Cortex-M, not to be a generic QEMU
target.
2019-12-07 16:47:40 +01:00
Ayke van Laethem
d441f0152f riscv: use LLVM tools instead of GNU toolchain
Now that we use LLVM 9, RISC-V support in LLVM has far fewer bugs and we
can avoid the GNU toolchain.

  * replace GNU linker with lld
  * replace GCC with clang

Additionally, RISC-V was promoted to stable so it can be enabled by
default in CI.
2019-12-07 16:27:10 +01:00
Ayke van Laethem
06647aab24 tools/gen-device-avr: process files in parallel
This significantly speeds up processing of the files.
2019-12-07 16:04:47 +01:00
Ayke van Laethem
24259cbb5f tools: rewrite gen-device-avr in Go
This brings a big speedup. Not counting gofmt time,
`make gen-device-avr` became about 3x faster. In the future, it might be
an idea to generate the AST in-memory and write it out already
formatted.
2019-12-07 16:04:47 +01:00
Ayke van Laethem
2f932a9eee riscv: fix heap corruption
The .sdata and .sbss sections are created by the compiler, but were not
present in the linker script. That means that the linker put them after
all other data/bss section, which happens to be where the heap also
resides.

This commit adds the .sdata and .sbss sections to the linker script,
which gets the blinky examples to work again on RISC-V.
2019-12-05 20:27:28 +01:00
Ayke van Laethem
93a06d1157 tools: avoid _paddingX in generated struct fields
This makes the generation script slightly simpler.
2019-12-04 23:11:42 +01:00
Ayke van Laethem
374349cfa5 compiler: refactor func lowering to the transform package
This commit makes a number of changes:

  * It avoids a dependency on Compiler.emitStartGoroutine.
  * It moves the func-lowering pass to the transform package.
  * It adds testing to func lowering.

No functionality should have changed with this commit.
2019-12-04 22:19:49 +01:00
Ron Evans
024a0827ea docs: add official code of conduct using 'Contributor Covenant'
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-12-04 21:53:46 +01:00
Ayke van Laethem
fadddc54a3 main: increment version to 0.11-dev 2019-12-03 21:02:37 +00:00
Ayke van Laethem
a44d74d4c0 main: version 0.10.0 2019-11-26 22:45:30 +01:00
Ayke van Laethem
24ff2d1ee2 interp: replace many panics with error messages
This commit replaces most panics in interp/frame.go and interp/scan.go
with real error messages. The remaining ones are panics that should not
happen when working with valid IR.
2019-11-26 15:45:39 +01:00
Ayke van Laethem
0db26b0662 interp: support integer icmp of ptrtoint
This kind of code might be generated by the switch implementation of
func values. The func value is represented as a ptrtoint, and before
calling it, it is compared against 0.
2019-11-26 14:43:05 +01:00
Ayke van Laethem
4f7a650614 interp: add test for icmp inttoptr workaround 2019-11-26 14:43:05 +01:00
Ayke van Laethem
e74db01f82 interp: improve error reporting
This commit improves error reporting in several ways:

  * Location information is read from the intruction that causes the
    error, as far as that's available.
  * The package that is being interpreted is included in the error
    message. This may be the most useful part of the improvements.
  * The hashmap update intrinsics now doesn't panic, instead it logs a
    clear error (with location information, as in the above two bullet
    points).

This is possible thanks to improvements in LLVM 9. This means that after
this change, TinyGo will depend on LLVM 9.
2019-11-26 07:18:42 +01:00