[top] Integrate usbdev using topgen
This commit integrates the USB device (usbdev) into the Earlgrey top
using topgen. The previous, manually maintained, top_earlgrey_usb
versions of the top level are removed and the hello_usbdev example is
added to CI as a first sanity check.
This commit also contains work from Srikrishna Iyer <sriyer@google.com>.
This resolves lowRISC/OpenTitan#52 and lowRISC/OpenTitan#1007.
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
diff --git a/sw/device/lib/usbdev.h b/sw/device/lib/usbdev.h
index 6e14770..4e4c19a 100644
--- a/sw/device/lib/usbdev.h
+++ b/sw/device/lib/usbdev.h
@@ -224,10 +224,18 @@
*/
void usbdev_init(usbdev_ctx_t *ctx);
-// Used for tracing what is going on
+// Used for tracing what is going on. This may impact timing which is critical
+// when simulating with the USB DPI module.
+//#define ENABLE_TRC
+#ifdef ENABLE_TRC
#include "sw/device/lib/uart.h"
#define TRC_S(s) uart_send_str(s)
#define TRC_I(i, b) uart_send_uint(i, b)
#define TRC_C(c) uart_send_char(c)
+#else
+#define TRC_S(s)
+#define TRC_I(i, b)
+#define TRC_C(c)
+#endif
#endif // OPENTITAN_SW_DEVICE_LIB_USBDEV_H_